Fix YANG export with duplicate imports 44/97344/4
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 26 Aug 2021 15:04:48 +0000 (17:04 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 20 Oct 2021 16:55:48 +0000 (18:55 +0200)
commitd08e5552beb9180f582bf419fdcf120052876411
treef92e03233abd5e7858932f11ff0b90568bc3901d
parentf3315447826f03a575282ded0cc60c854ee90606
Fix YANG export with duplicate imports

When we have two submodules not agreeing on the prefix used to import a
module, we get a nasty splat from StatementPrefixResolver. Fix this by
detecting when this is happens and skip to full resolution magic.

JIRA: YANGTOOLS-1313
Change-Id: I99cc3ebc2f560590d05b51287d08429aaf7d6582
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Dominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
model/yang-model-export/src/main/java/org/opendaylight/yangtools/yang/model/export/StatementPrefixResolver.java
model/yang-model-export/src/test/java/org/opendaylight/yangtools/yang/model/export/YT1313Test.java [new file with mode: 0644]
model/yang-model-export/src/test/resources/bugs/yt1313/bar-one.yang [new file with mode: 0644]
model/yang-model-export/src/test/resources/bugs/yt1313/bar-two.yang [new file with mode: 0644]
model/yang-model-export/src/test/resources/bugs/yt1313/bar.yang [new file with mode: 0644]
model/yang-model-export/src/test/resources/bugs/yt1313/foo.yang [new file with mode: 0644]