Fix YANG export with duplicate imports 06/98006/1
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 17:27:36 +0000 (19:27 +0200)
commitf6e38129baca7d40aa8a748c44313edd909f7ff0
treeb3a379691e8ef1824d98895d37c74c929bc1f266
parent6da9374f34b6ae5adc27b0bbaa1e277ce7240321
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>
(cherry picked from commit d08e5552beb9180f582bf419fdcf120052876411)
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]