Avoid module namespace/submodule name conflict when using lib sources 34/63034/2
authorIgor Foltin <igor.foltin@pantheon.tech>
Tue, 12 Sep 2017 12:34:12 +0000 (14:34 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 13 Sep 2017 08:48:07 +0000 (08:48 +0000)
commit5a3ab6032b66433b9147a3fcad214b6f9a4b56e7
treeea0ec3b403beafb3dcd65dc0e749fd5bc294f2d6
parentae6268b37a15a3964429dbf125a7661cdc67edc9
Avoid module namespace/submodule name conflict when using lib sources

The issue comes up when using yang-system-test artifact as a single
YANG file validator:

A parent module or a submodule is specified as its argument
and the same directory is specified as one of the library dirs
using the -p option.

The parent module/submodule ends up being added twice to the parsed
sources which causes a module namespace/submodule name collision later
in the parsing process.

Therefore remove the conflicting lib sources from the collection of
required lib sources before they cause any trouble.

Change-Id: Id41d9f57006adec7ff658904792f9bc319b8c11e
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/BuildGlobalContext.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug7480Test.java
yang/yang-parser-impl/src/test/resources/bugs/bug7480/main-source-lib-source-conflict-test/child-module.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug7480/main-source-lib-source-conflict-test/parent-module.yang [new file with mode: 0644]