Fix NPE when parsing deviation from submodule 84/103284/1
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 21:01:43 +0000 (22:01 +0100)
commit7d9fe5089780044a3a78bd1f76fd01fd9822b8fd
treee2cccceff7929e94429e713973e837df4083415c
parentb6576e3b3c1334fce28f836cd1549507c4d9fdd3
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>
(cherry picked from commit 274de5b85ab4626c0ba6f79c38e8dd2e5b0eddcb)
(cherry picked from commit 049a6ac5bbc8d535a15bcad8c6fc879e2c533881)
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]