Fix unique statement argument propagation 35/103735/1
authorSangwook Ha <sangwook.ha@verizon.com>
Sat, 3 Dec 2022 23:19:45 +0000 (15:19 -0800)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 23 Dec 2022 11:28:35 +0000 (12:28 +0100)
commit23c5afa5153577de85a0282e31477a624333e4e3
treef7d3949d3bc3db962fc12b35162c5011a81aeecf
parent7fab26ae5dc976fdd4b19d6f30029686b6a13c17
Fix unique statement argument propagation

Augmentation to the list with a unique statement from a module different
from the one where the list is defined causes SourceException which
complains that the argument node of the unique statement does not exist.

This turns out to have already been flagged with a FIXME -- this
behaviour has been there since forever.

The correct behaviour is to use a StatementPolicy.copyDeclared() and
adjust QNames in the argument's Descendants.

JIRA: YANGTOOLS-1470
Change-Id: Ib2cd23d50cd881d2ae94dbc0b271b5d481c9f55c
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
(cherry picked from commit 7e849648fed0d0a195f83d43d1a7d015478ad1eb)
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/meta/UniqueStatementSupport.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1470Test.java [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1470/bar.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1470/foo.yang [new file with mode: 0644]