Bug 6669: Mandatory nodes cannot be added to node from another module via augment 82/45382/15
authorPeter Kajsa <pkajsa@cisco.com>
Thu, 8 Sep 2016 14:25:48 +0000 (16:25 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 25 Oct 2016 08:58:57 +0000 (08:58 +0000)
commit092e3656c2276fb4559b336264339e8fb6f38ae9
treebb74cf2a76874e66cdf1fd665210b9140898a981
parenta597ca7887ffa4b0fc9a5914cb9eeb47263c9251
Bug 6669: Mandatory nodes cannot be added to node from another module via augment

Yang parser allowed to add mandatory nodes to target node from another module
via augmentations in some cases. This patch fixes this according to the rules defined
in RFC6020 (https://tools.ietf.org/html/rfc6020#section-3.1,
https://tools.ietf.org/html/rfc6020#section-7.15).

Change-Id: I699fc3c1014583b85ea47504f9a102d06e0b9011
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
18 files changed:
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StmtContextUtils.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/AugmentUtils.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/Utils.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug5335Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6669Test.java [new file with mode: 0644]
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserNegativeTest.java
yang/yang-parser-impl/src/test/resources/bugs/bug6669/invalid/test1/bar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/invalid/test1/foo.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/invalid/test2/bar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/invalid/test2/foo.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/invalid/test3/bar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/invalid/test3/foo.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/valid/test1/bar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/valid/test1/foo.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/valid/test2/bar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/valid/test2/foo.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/valid/test3/bar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6669/valid/test3/foo.yang [new file with mode: 0644]