Fix BindingStructuralType.isNotAddressable() 53/109653/7
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 6 Jan 2024 04:09:22 +0000 (05:09 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 8 Jan 2024 08:13:38 +0000 (09:13 +0100)
The check is missing the anydata case, fix that.

Change-Id: I73053c24afb69f28b13f42b68fc3a41e2fb78172
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/BindingStructuralType.java
binding/mdsal-binding-dom-adapter/src/test/java/org/opendaylight/mdsal/binding/dom/adapter/BindingStructuralTypeTest.java

index 71aeb9b2923fba2577dba0bc730d698283d9c4b7..8927cb40e13d9ee7c95e5ab51af74dc53e256d78 100644 (file)
@@ -11,6 +11,7 @@ import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.AnydataNode;
 import org.opendaylight.yangtools.yang.data.api.schema.AnyxmlNode;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -128,6 +129,7 @@ public enum BindingStructuralType {
     private static boolean isNotAddressable(final NormalizedNode normalizedNode) {
         return normalizedNode instanceof LeafNode
                 || normalizedNode instanceof AnyxmlNode
+                || normalizedNode instanceof AnydataNode
                 || normalizedNode instanceof LeafSetNode
                 || normalizedNode instanceof LeafSetEntryNode
                 || normalizedNode instanceof UnkeyedListNode
index 18273b5b010d0538c6d8217f9440fe1311f7bce8..a0638fdd23777e06d1d6fec69247ba0e1d9abcef 100644 (file)
@@ -27,6 +27,6 @@ class BindingStructuralTypeTest {
     @Test
     void basicTest() {
         doReturn(normalizedNode).when(dataTreeCandidateNode).dataBefore();
-        assertEquals(BindingStructuralType.UNKNOWN, BindingStructuralType.from(dataTreeCandidateNode));
+        assertEquals(BindingStructuralType.NOT_ADDRESSABLE, BindingStructuralType.from(dataTreeCandidateNode));
     }
 }
\ No newline at end of file