Fix YANG export with duplicate imports 07/98007/3
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 18:56:02 +0000 (20:56 +0200)
commitd0065308ebab7840ccd320435368a0bf1db3282f
tree29e9617aaffe7eb3fc51cfcf8d99aacc1898879b
parent17939d2f813abcafe3501afbc4259d2e42180fe7
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)
yang/yang-model-export/src/main/java/org/opendaylight/yangtools/yang/model/export/StatementPrefixResolver.java
yang/yang-model-export/src/test/java/org/opendaylight/yangtools/yang/model/export/YT1313Test.java [new file with mode: 0644]
yang/yang-model-export/src/test/resources/bugs/yt1313/bar-one.yang [new file with mode: 0644]
yang/yang-model-export/src/test/resources/bugs/yt1313/bar-two.yang [new file with mode: 0644]
yang/yang-model-export/src/test/resources/bugs/yt1313/bar.yang [new file with mode: 0644]
yang/yang-model-export/src/test/resources/bugs/yt1313/foo.yang [new file with mode: 0644]