Fix isSupportedToBuildEffective() propagation 54/103354/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 22 Nov 2022 17:47:49 +0000 (18:47 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Nov 2022 15:06:47 +0000 (16:06 +0100)
commit89712e2e30161966b8568080ec798321b4f15d10
treed3c36a2e06eb4e3220905a8f7180af1e0b827fb2
parent5d3be14b7f9d93b7d1ea2550c04f9332675c100b
Fix isSupportedToBuildEffective() propagation

InferredStatementContext has bad interaction with ImplictStmtCtx -- the
latter fizzles when it is not supported by features. This leads to a
failure to build effective context, as the prototype cannot be built and
therefore an attempt to reuse it fails.

Adjust InferredStatementContext to check if its prototype can be built
and carry over that fact when it is not.

JIRA: YANGTOOLS-1465
Change-Id: Iad05b0c6a06b6d9f837b70ced0da8cdc8ed3ed97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e31531765d8ae6e3bc36f3de4ae4e14e06568e83)
parser/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/InferredStatementContext.java
parser/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ReactorStmtCtx.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1465Test.java [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1465/foo.yang [new file with mode: 0644]