Fix StatementContextBase.childCopyOf() 65/97865/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Oct 2021 12:15:45 +0000 (14:15 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Oct 2021 12:29:09 +0000 (14:29 +0200)
commit3b4308a5a4988fb66839c8d2724c13e0ae1b2e9c
tree7a0009256befeb035399f286a8e9ae9811fdd6a1
parent213f9b58d6e73d8760fc3daee16117d17a13d8d0
Fix StatementContextBase.childCopyOf()

Most of our StmtContext implementations are derived from
StatementContextBase, but notably ReplicaStatementContext is not -- and
we do not handle it during copy operations.

Update the dispatch code to short circuit to replicaAsChildOf(), which
takes care of the details.

JIRA: YANGTOOLS-1346
Change-Id: I65f9713d5c06bbe251a4b27fb0745dd905c36976
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
parser/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementContextBase.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1346Test.java [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1346/foo.yang [new file with mode: 0644]