Modernize SchemaInferenceStack 89/108689/4
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 26 Oct 2023 19:30:37 +0000 (21:30 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 27 Oct 2023 09:11:30 +0000 (11:11 +0200)
commit7f33d6b45cf6f17a502d546a41b0f9d2c767f7a1
tree3648909cb56f69dab7a1f538c0c775e40958088c
parent384edb753b10971da6bfcb7bfb9bf84b78fb270a
Modernize SchemaInferenceStack

Use local variable type inference and instanceof patterns to reduce the
number of explicit type declarations and casts.

Also (mostly) migrate away from verify()/checkState()/checkArgument(),
exposing further branches that should be tested and a potentially-dead
code.

Change-Id: I656bdc230393f736f57b80f8256fd726079edf9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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/SchemaInferenceStackTest.java
model/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/YT1414Test.java