Bug 5883 - no constructor for indentityref in union 22/38822/8
authorIsaku Yamahata <isaku.yamahata@intel.com>
Tue, 10 May 2016 19:55:54 +0000 (12:55 -0700)
committerRobert Varga <nite@hq.sk>
Sat, 28 May 2016 21:13:19 +0000 (21:13 +0000)
commit4692da9978ca3ec59c0acf49c10b55111ecff790
tree937dc0714a9fbce9cff82710dd0cb04daa7fbedf
parent32d45af3bfde08f4e8741632ecab43241831d1fe
Bug 5883 - no constructor for indentityref in union

The generated java code for union with identityref doens't include a
constructor for identityref.

module union-with-identityref {
    yang-version 1;
    namespace "urn:opendaylight:yang:union:test";
    prefix "uniontest";

    description "test union with identityref";

    revision "2016-05-09";

    identity ident-base;
    identity ident-one {
        base ident-base;
    }
    identity ident-two {
        base ident-base;
    }

    typedef union-type {
        type union {
            type uint8;
            type identityref {
                base ident-base;
            }
        }
    }
}

generated java code:
public class UnionType
 implements Serializable {
    private static final long serialVersionUID = 4724108168179933454L;
    private final java.lang.Short _uint8;
    private final char[] _value;

    public UnionType(java.lang.Short _uint8) {
        super();
        this._uint8 = _uint8;
        this._value = _uint8.toString().toCharArray();
    }

Change-Id: Idf8f7df54afd0934e47b19c131ea41d046a7b5df
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
binding/mdsal-binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/yang/types/TypeProviderImpl.java
binding/mdsal-binding-java-api-generator/src/test/java/org/opendaylight/yangtools/sal/java/api/generator/test/UnionWithIdentityrefTest.java [new file with mode: 0644]
binding/mdsal-binding-java-api-generator/src/test/resources/compilation/union-with-identityref/union-with-identityref.yang [new file with mode: 0644]