Restore unrecognized statement defensiveness 62/95362/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 19:37:20 +0000 (20:37 +0100)
commita436c9f65f895af8876f02343a3561435091ad46
treec5bf9d360a1a8641a77cdab265f2323192eed224
parent3d839521f5f460bce42a82998770494274310b22
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>
(cherry picked from commit 99d0a43d0f67ab0b98d56ac4a5b51cb7b1f76e80)
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]