Fix codegen of root choices 77/72377/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 28 May 2018 17:51:15 +0000 (19:51 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 28 May 2018 19:28:00 +0000 (21:28 +0200)
commitf6e117a1e6a41447823258ac525ffcec4781ef0b
tree8c58ffcc94ee96086f8900395afda385bf212020
parentaa92942e2b516b0c14c7bbd5048c398c3ccc9ce0
Fix codegen of root choices

If a choice which is a direct child of a module is targeted via
an augment, codegen fails.

The reason for this is that it attempts to use an empty SchemaPath
to find a DataSchemaNode: something that cannot be done. The problem
is the assumption that a Module is a SchemaNode -- which it is not.

To fix this, recognize when the parent path is empty and short-circuit
to the defining module if that is the case.

JIRA: MDSAL-345
Change-Id: I52679c822b220271d943bfbc421049d2dc394d70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator-impl/src/main/java/org/opendaylight/mdsal/binding/generator/impl/AbstractTypeGenerator.java