Bug 6771: Problem with typedefs nested in augment 31/46531/1
authorIgor Foltin <ifoltin@cisco.com>
Wed, 5 Oct 2016 07:00:07 +0000 (09:00 +0200)
committerIgor Foltin <ifoltin@cisco.com>
Wed, 5 Oct 2016 07:00:07 +0000 (09:00 +0200)
commit354c0475d65f0382e6c52b86b98f5c9f3b1a5e74
treebaa2c5c72620cd776d52808bf38285f1471aa40c
parent107826f9cd33c98f7e021e7147f1806e25b9c074
Bug 6771: Problem with typedefs nested in augment

When a typedef is nested in a container that is in an augment,
the YANG parser produces an error. This is due to fact, that typedef
statements nested in augments are ignored in statement definition phase,
because AugmentStatement is supported only in full definition phase. The
same issue occurs also for Choice and Case statements. This patch
provides fix of these bugs.

This patch is a manual cherry-pick of the following patch:
git.opendaylight.org/gerrit/#/c/46223/

Change-Id: I345fd50e7d9810bbedcc873241338fbdb3186b74
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/TypedefStatementImpl.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6771Test.java [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6771/augment/typedef-bug.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6771/choice-case/typedef-bug.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6771/grouping/typedef-bug.yang [new file with mode: 0644]