Bug 2333 - Java code generation error, when yang model contains Choice node 13/12813/13
authorpkajsa <pkajsa@cisco.com>
Thu, 13 Nov 2014 13:51:20 +0000 (14:51 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 7 May 2015 09:36:23 +0000 (09:36 +0000)
commit9af32f6d5f9da9f384d491e5066ea2423763e9c9
treeeb616175261f8f59fb561f81b6a9f31f13b5aa32
parent2d7548bb1ebb925625358da86fba0831cd9b73ad
Bug 2333 - Java code generation error, when yang model contains Choice node
in module body at top level

BindingGeneratorImpl fails (NoSuchElementException) during java source code
generation from yang model which contains Choice node directly in module body
at top level. The parent path of Choice node is empty (because the parent
is the module) and therefore iterator.next() on the path fails. For more
information see Bug 2333.

Change-Id: I6e617eca91bb5d8d2b91ad058a4df5c2793ec81d
Signed-off-by: pkajsa <pkajsa@cisco.com>
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/BindingGeneratorImpl.java
code-generator/binding-generator-impl/src/test/java/org/opendaylight/yangtools/sal/binding/generator/impl/BindingGeneratorImplTest.java [new file with mode: 0644]
code-generator/binding-generator-impl/src/test/resources/binding-generator-impl-test/choice-test.yang [new file with mode: 0644]