Bug4231 - Yang tools failing to parse Augmentations under "uses" clause. 29/26329/4
authorPeter Kajsa <pkajsa@cisco.com>
Wed, 2 Sep 2015 11:49:20 +0000 (13:49 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 24 Sep 2015 18:25:11 +0000 (18:25 +0000)
commitd417276b1c26ab5029b381657fd0be810970e572
treef50dd5c9c815c282fb38a33cc26a47f9b0f1fa0d
parent56ff9897e2990bfe97334a48769e4df1e5f19a7d
Bug4231 - Yang tools failing to parse Augmentations under "uses" clause.

The problem occurs when uses-augment is nested in another Augment statement.
In this case the parent node of uses node is not subclass of SchemaNode
but it is AugmentationSchemaNode (it is not subclass of SchemaNode) and in
consequence class cast exception occurs.

Change-Id: I674392889e561f357297fa220051e8c3728f537d
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/BuilderUtils.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/YangParserImpl.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/impl/Bug4231Test.java [new file with mode: 0644]
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/impl/TestUtils.java
yang/yang-parser-impl/src/test/resources/bugs/bug4231/foo.yang [new file with mode: 0644]