Fix statement prerequisites and materialization 76/101176/5
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 17 May 2022 10:57:32 +0000 (12:57 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 18 May 2022 13:15:10 +0000 (15:15 +0200)
commita257eeb5333f6719db8afed7258fa0ce3dbdc0ae
tree2a7ee17c96e184bdbf34d509f830e6ca71092be5
parent32aeb53bf28c97c1a47b8e5c4eb2f211fdc92c58
Fix statement prerequisites and materialization

We are firing onStatementAdded() when copying statements, which means
that:
a) a new inference requirement may be created during inferred
   statemenent materialization
b) the inference requirement may be immediately available in effective
   model

In order to deal with this, ModifierImpl has to always go through a
bootstrap, so that it prerequisites only trigger once an action is
registered.

Furthermore InferredStatementContext needs always instantiate the map
for partial instantiations so as to deal with namespace-driven
instantiations happening while full instantiation is going on.

JIRA: YANGTOOLS-1434
Change-Id: I86dae587c1fe5804cd983c194903e1975f257408
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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/ModifierImpl.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1434Test.java [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1434/bar.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1434/foo.yang [new file with mode: 0644]