[MDSAL-320] Binding V1 fails to generate code for nested enumeration/union construct Created: 12/Mar/18  Updated: 28/Jul/18  Resolved: 28/Jul/18

Status: Resolved
Project: mdsal
Component/s: Binding codegen
Affects Version/s: None
Fix Version/s: Fluorine

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
is blocked by MDSAL-321 Binding V1 generates incorrect code f... Resolved

 Description   

A slightly contorted use case of:

    container foo {
        leaf bar {
            type union {
                type enumeration {
                    enum "foo";
                }
                type string {
                    length 2;
                }
                type union {
                    type enumeration {
                        enum bar;
                    }
                    type string {
                        length 1;
                    }
                }
            }
        }
    }

results in a failure to compile:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project mdsal-binding-test-model: Compilation failure
[ERROR] /home/nite/odl/mdsal/binding/mdsal-binding-test-model/target/generated-sources/mdsal-binding/org/opendaylight/yang/gen/v1/opendaylight/nested/types/norev/Foo.java:[313,35] cannot find symbol
[ERROR]   symbol:   method getValue()
[ERROR]   location: variable _bar1 of type org.opendaylight.yang.gen.v1.opendaylight.nested.types.norev.Foo.Bar.Bar1


 Comments   
Comment by Robert Varga [ 12/Mar/18 ]

This seems to be confusion around assigning identifiers in nested classes. Let's solve MDSAL-321 first, which may end up shaking out a fix for this issue, too.

Comment by Robert Varga [ 19/Mar/18 ]

https://git.opendaylight.org/gerrit/69610 adds the basic unit test

Generated at Wed Feb 07 20:09:31 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.