BUG-4295: instantiate MERGE operations lazily
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / UnorderedLeafSetModificationStrategy.java
index 8e001d0c7c3ab214f061c99c49bf5e9a3b3c0483..e52325ea79a7936b74f06f79ef78cab587609017 100644 (file)
@@ -34,6 +34,13 @@ final class UnorderedLeafSetModificationStrategy extends AbstractNodeContainerMo
         return ImmutableLeafSetNodeBuilder.create((LeafSetNode<?>) original);
     }
 
+    @Override
+    protected NormalizedNode<?, ?> createEmptyValue(NormalizedNode<?, ?> original) {
+        checkArgument(original instanceof LeafSetNode<?>);
+        return ImmutableLeafSetNodeBuilder.create().withNodeIdentifier(((LeafSetNode<?>) original).getIdentifier())
+                .build();
+    }
+
     @Override
     public Optional<ModificationApplyOperation> getChild(final YangInstanceIdentifier.PathArgument identifier) {
         if (identifier instanceof YangInstanceIdentifier.NodeWithValue) {