Fix unique statement argument propagation 54/103554/6
authorSangwook Ha <sangwook.ha@verizon.com>
Sat, 3 Dec 2022 23:19:45 +0000 (15:19 -0800)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Dec 2022 22:59:37 +0000 (23:59 +0100)
commit7e849648fed0d0a195f83d43d1a7d015478ad1eb
tree590033d4ec77aee38a6fa306b19505bc38ccc511
parent27a92200c91caa63b51a67972da33c63a677209f
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>
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]