Restore unrecognized statement defensiveness 99/94999/3
authorSamuel Kontris <samuel.kontris@pantheon.tech>
Thu, 25 Feb 2021 18:09:20 +0000 (19:09 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 26 Feb 2021 14:36:36 +0000 (15:36 +0100)
commit99d0a43d0f67ab0b98d56ac4a5b51cb7b1f76e80
tree804a03790ad1855e47f6e11777ed99426dc037ad
parent5ae728e3eeb8b8faa261d4338ae24c5d4758df1c
Restore unrecognized statement defensiveness

We are in a bad place here, as we are trying to come up with
something that passes for a QName based on zero understanding
of argument structure.

Previous cleanup of the logic here, done in YANGTOOLS-1191
omitted a possible source of errors -- when the value contains
something resembling a qualified node identier to the point
of actually resolving to a module -- but the localname part
is not actually valid.

Fix this by going through UnqualifiedQName.tryCreate(), just
as we do in the unqualified case.

The test model is a simplified version of tailf yang models
(specifically "tailf-ncs-devices@2020-02-04.yang" model), where
the argument structure is actually a descendant schema node
identifier.

JIRA: YANGTOOLS-1261
Change-Id: I885828221382f5689b491f26161b35987dfd4482
Signed-off-by: Samuel Kontris <samuel.kontris@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/extension/UnrecognizedEffectiveStatementImpl.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1261Test.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/yt1261.yang [new file with mode: 0644]