Do do not check unique in unsupported lists 83/104383/2
authorSangwook Ha <sangwook.ha@verizon.com>
Mon, 30 Jan 2023 21:50:33 +0000 (13:50 -0800)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 14 Feb 2023 09:08:51 +0000 (10:08 +0100)
commit0234c1791a1581ba5f3a58f179af6a65142c1fc1
tree27f71e17da3324bd78dca2ac47acb3fca8072216
parent341d782812576fd701974cbd86460f4833f06b5d
Do do not check unique in unsupported lists

Parsing of YANG models fails if a list conditional on a feature has a
unique statement and the feature is not supported.

Add test cases to reproduce the issue and fix
RequireEffectiveList.isApplicable() to also check for
isSupportedByFeatures().

JIRA: YANGTOOLS-1481
Change-Id: Id73f3f36fc5300e4c9fe97c32a25e58ab75078e4
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a94cb0f875a6b56360f64a6ba49d209a3dddd1ee)
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/meta/UniqueStatementSupport.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1481Test.java [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1481/bar-feature/foo.yang [new file with mode: 0644]
parser/yang-parser-rfc7950/src/test/resources/bugs/YT1481/foo-feature/foo.yang [new file with mode: 0644]