Add the parent module of a submodule to the set of required lib sources 33/62833/2
authorIgor Foltin <igor.foltin@pantheon.tech>
Thu, 7 Sep 2017 11:41:55 +0000 (13:41 +0200)
committerRobert Varga <nite@hq.sk>
Sat, 9 Sep 2017 06:00:25 +0000 (06:00 +0000)
commit9e32f77bd3ddadb98122e9978f1cd9153aa189ad
tree9ae4c7d127326752e77b4a25d7e7345c62deacfe
parentf1193617e74d40724cc53df1f5a4f007dc135f2b
Add the parent module of a submodule to the set of required lib sources

This issue is related to the following use case of YANG statement parser:
If we add a YANG submodule as a main source and its parent module
as a library source, YANG statement parser does not add the parent module
to the set of requires lib sources. This causes an Exception as the parser
cannot resolve belongs-to statement in the submodule.

This patch fixes the issue.

Change-Id: Icbfddbbbecec310f0f7de17456e6a12dab8167d6
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/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/BelongsToStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/YangInferencePipeline.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug7480Test.java
yang/yang-parser-impl/src/test/resources/bugs/bug7480/files/sub-mod.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug7480/lib/parent-mod.yang [new file with mode: 0644]