Fix unique statement argument propagation 32/103732/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:25:06 +0000 (12:25 +0100)
commitdd68bd3ac7e7ef483313d010b2211627bc0097a9
treea6ea3cb8b31cb0afbd08b8bc80899ea3d5fc0ff7
parentdd4e986f37c177c756c358ac1c89b298c9f8208a
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]