Fix ListModificationStrategy child handling 11/93911/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 20 Nov 2020 19:55:11 +0000 (20:55 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 22 Nov 2020 16:51:51 +0000 (17:51 +0100)
We have an obviously bad cast here, correct that.

JIRA: YANGTOOLS-1180
Change-Id: I706a5335e899e182e4651e9134f608a6e7094c37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 398d1aa8ca1cc91eff5bb6062fbf228eefca4da3)

yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ListModificationStrategy.java

index c8018ae90be94d9cc3438022d3ff74da05830e61..b311687dea1cf59092314932c94b82e3429dd46d 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
 
 final class ListModificationStrategy extends SchemaAwareApplyOperation<ListSchemaNode> {
@@ -86,11 +87,8 @@ final class ListModificationStrategy extends SchemaAwareApplyOperation<ListSchem
         final MutableTreeNode mutable = newValueMeta.mutable();
         mutable.setSubtreeVersion(version);
 
-        @SuppressWarnings("rawtypes")
-        final NormalizedNodeContainerBuilder dataBuilder =
-            ImmutableUnkeyedListEntryNodeBuilder.create((UnkeyedListEntryNode) newValue);
-
-        return mutateChildren(mutable, dataBuilder, version, modification.getChildren());
+        return mutateChildren(mutable, ImmutableUnkeyedListNodeBuilder.create((UnkeyedListNode) newValue), version,
+            modification.getChildren());
     }
 
     /**