Fix NPE when parsing deviation from submodule 29/103229/4
authorRuslan Kashapov <ruslan.kashapov@pantheon.tech>
Tue, 15 Nov 2022 15:41:31 +0000 (17:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 16 Nov 2022 20:13:05 +0000 (21:13 +0100)
commit274de5b85ab4626c0ba6f79c38e8dd2e5b0eddcb
treebb91e854f9b7e4821d9e0de4f7d524f7684bc66e
parentb6ebfe2a7cebefe8755e6c40c88267adf65fb2ee
Fix NPE when parsing deviation from submodule

If the deviation statement is used in a submodule, we need to lookup up
the corresponding module, otherwise we will not find the correct
namespace.

JIRA: YANGTOOLS-1448
Change-Id: Iaf2e1d6526a9f268a6c0a3835e1bfdfafa05fffe
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/meta/DeviationStatementSupport.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1448Test.java [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1448/invalid/foo-submodule.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1448/invalid/foo.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1448/valid/bar.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1448/valid/foo-submodule.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1448/valid/foo.yang [new file with mode: 0644]