Add DefaultSchemaTreeInference.unsafeOf() 14/100414/14
authorSamuel Schneider <samuel.schneider@pantheon.tech>
Tue, 5 Apr 2022 11:23:48 +0000 (13:23 +0200)
committerRobert Varga <nite@hq.sk>
Sun, 10 Apr 2022 16:02:56 +0000 (16:02 +0000)
commit046b425b63f0c3edb6d9dbc702f6255c09eef994
treedc8ff0a2b5cf51889198192776981dc650d0b8c8
parent23b28245aa3067ef3f1d2c76f782a69a43f1cbf1
Add DefaultSchemaTreeInference.unsafeOf()

SchemaInferenceStack is routinely converted to DefaultSchemaTreeInference
as well as reconstructed from it. This process currently involves
a complete schema tree walk in both directions.

Introduce DefaultSchemaTreeInference.unsafeOf() which nominally trusts
the provided argument, so that we use it as is. The method can be
instructed to verify the provided argument by setting a system property.

On the SchemaInferenceStack side, trust the documented well-formedness
of DefaultSchemaTreeInference.

JIRA: YANGTOOLS-1414
Change-Id: Ifa2f0418c561795595d8dae70f6b0c61a33d8f43
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-model-spi/src/main/java/org/opendaylight/yangtools/yang/model/spi/DefaultSchemaTreeInference.java
model/yang-model-spi/src/test/java/org/opendaylight/yangtools/yang/model/spi/YT1414Test.java [new file with mode: 0644]
model/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/SchemaInferenceStack.java
model/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/YT1414Test.java [new file with mode: 0644]
model/yang-model-util/src/test/resources/yt1414.yang [new file with mode: 0644]