Bug 2333 - Java code generation error, when yang model contains Choice node 84/19784/2
authorpkajsa <pkajsa@cisco.com>
Thu, 13 Nov 2014 13:51:20 +0000 (14:51 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 12 May 2015 12:47:03 +0000 (12:47 +0000)
commita8113d675421595658906db5babbd55bd8af0960
tree518a5806bae7cb778e1a1d31813c305ac7e44eef
parenta6a2f886e3fdc9b68c3fbaf59062bc0059bdc3c5
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>
(cherry picked from commit 9af32f6d5f9da9f384d491e5066ea2423763e9c9)
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]