Move list/key checks to onStatementAdded() 29/94629/5
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 14 Jan 2021 12:04:57 +0000 (13:04 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 14 Jan 2021 12:57:50 +0000 (13:57 +0100)
commita36fd793d86133286a46bf277f90c9a52f74b992
treebb9f2bc29e5f7f92e60a72c96b0eae52d3ecb7aa
parentcf7761eb2644aa7befa084c50d6c1a10b1749623
Move list/key checks to onStatementAdded()

We do not want to use the rabbit hole to StmtContext during effective
build, but rather perform the check as soon as the statement is added.

Depending on how the model is structured action/notification declaration
might happen before the key's presence is established and therefore
we perform an eager check first, but pay attention to ancestor's state.

If we encounter an ancestor which has not completed FULL_DECLARATION,
we hook an inference check to run just before it does.

JIRA: YANGTOOLS-1186
Change-Id: I8d8871a0eae860ba2327d05c43355a7ee3ffd382
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/action/ActionStatementSupport.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/notification/AbstractNotificationStatementSupport.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/notification/NotificationStatementRFC6020Support.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/notification/NotificationStatementRFC7950Support.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StmtContextUtils.java