Resolve bits/union nested type naming 44/82744/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 25 Jun 2019 13:07:06 +0000 (15:07 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 27 Jun 2019 16:29:58 +0000 (16:29 +0000)
commit30952238d240260310d357c2e80be55021ccb1fc
tree890514db4c8f15388887c9cad1e1e37e7d04d558
parent6dc51cf8c51ab6f5e6a32fbee70f0b1911880ceb
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>
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