Resolve bits/union nested type naming 62/82762/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 25 Jun 2019 13:07:06 +0000 (15:07 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 27 Jun 2019 16:30:41 +0000 (18:30 +0200)
commitc8aff96884b6b9501df50c906fa4f1d67ed77344
treeee9529c707909d749b08220339e99fd2a570f43b
parent49763fcb1d351e7f5e79d72d4455296117bda2a0
Resolve bits/union nested type naming

The cases where we allocate an enumeration, bits or union type
for a leaf-like construct (leaf, leaf-list) need to handle an
edge case -- JLS does not allow nested classes to be named the
same as the enclosing class.

Enumeration case was already handled in
AbstractGeneratedTypeBuilder, this patch extends that support
to handle bits and union.

JIRA: MDSAL-458
Change-Id: Idc19b179274c7973ed205ffdae1d2242cbd2dbf6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 30952238d240260310d357c2e80be55021ccb1fc)
binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/JavaTypeName.java
binding/mdsal-binding-generator-impl/src/main/java/org/opendaylight/mdsal/binding/generator/impl/AbstractTypeGenerator.java
binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/Mdsal448Test.java
binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/Mdsal458Test.java [new file with mode: 0644]
binding/mdsal-binding-generator-impl/src/test/resources/mdsal458.yang [new file with mode: 0644]
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AbstractGeneratedTypeBuilder.java