Bug 7954: Throw an exception when parsing duplicate (sub)modules 83/53283/6
authorIgor Foltin <ifoltin@cisco.com>
Tue, 14 Mar 2017 16:11:33 +0000 (17:11 +0100)
committerRobert Varga <nite@hq.sk>
Thu, 16 Mar 2017 11:53:44 +0000 (11:53 +0000)
commita8e1ea631e1948663dded681e16645505c7c7db8
tree3a273721e02884baa0255e09eb12e66f8438d501
parent515f08a3e800a31814282b326c6abd4948723a8b
Bug 7954: Throw an exception when parsing duplicate (sub)modules

In case we add the same YANG (sub)module to the YANG parsing
cycle twice, throw a SourceException which reports the problem
with colliding namespaces/names.

Change-Id: If0a0aff23ace2cdcbb3d87b639c9ef74f2302432
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
13 files changed:
yang/yang-maven-plugin-it/src/test/resources/test-parent/GenerateTest1/src/main/resources/testfile1.yang
yang/yang-maven-plugin-it/src/test/resources/test-parent/GenerateTest1/src/main/resources/testfile2.yang
yang/yang-maven-plugin-it/src/test/resources/test-parent/GenerateTest1/src/main/resources/testfile3.yang
yang/yang-maven-plugin-it/src/test/resources/test-parent/files/testfile1.yang
yang/yang-maven-plugin-it/src/test/resources/test-parent/files/testfile2.yang
yang/yang-maven-plugin-it/src/test/resources/test-parent/files/testfile3.yang
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ModuleStatementSupport.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/SubmoduleStatementImpl.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug7954Test.java [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug7954/bar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug7954/foo.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug7954/subbar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/negative-scenario/testfile3.yang