Refactor ConfigListWarningNamespace 97/93997/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 1 Dec 2020 21:55:19 +0000 (22:55 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 2 Dec 2020 09:29:13 +0000 (10:29 +0100)
commit0a297e75ee792d3369b6a9fa161aa596c10b9f3d
treea88f2208efd653d1bb5e242469ba519fce2c6d9b
parent843ec55c169a3b838770ec45cd96c033f4805815
Refactor ConfigListWarningNamespace

We are using a boolean to suppress warnings for particular statements
here. There are two problems here:

1. we can end up accessing the namespace after originalCtx has been
   built, which is not nice, as it cannot be swept
2. we make poor use of namespace's capabilities (we just hold a boolean)

Make ConfigListWarningNamespace a global namespace, hence it end up
being hosted BuildGlobalContext, hence is always accessible.

Furthermore make the connection that a StatementSourceReference
is good enough alias for the statement, hence we can just store those,
reducing the number of places where StmtContexts can lurk.

JIRA: YANGTOOLS-1184
Change-Id: I31629f73e095301617254be30e10a695d13309ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/list/AbstractListStatementSupport.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/list/ConfigListWarningNamespace.java