Bug 4295: Fixed incorrectly introduced nodes when MERGE was followed by DELETE
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / InstanceIdToSimpleNodes.java
index 7a3e86a77a92ddb527c51f2bca80610ab10d50be..ab62d4cc28f17f454f2936872cefb3c302d8bf13 100644 (file)
@@ -8,10 +8,8 @@
 package org.opendaylight.yangtools.yang.data.impl.schema;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Iterables;
 import java.util.Map;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.ModifyAction;
@@ -35,7 +33,7 @@ abstract class InstanceIdToSimpleNodes<T extends YangInstanceIdentifier.PathArgu
     @Override
     public NormalizedNode<?, ?> create(final YangInstanceIdentifier instanceId, final Optional<NormalizedNode<?, ?>> deepestChild, final Optional<Map.Entry<QName,ModifyAction>> operation) {
         checkNotNull(instanceId);
-        final YangInstanceIdentifier.PathArgument pathArgument = Iterables.get(instanceId.getPathArguments(), 0);
+        final YangInstanceIdentifier.PathArgument pathArgument = instanceId.getPathArguments().get(0);
         final NormalizedNodeAttrBuilder<? extends YangInstanceIdentifier.PathArgument, Object, ? extends NormalizedNode<? extends YangInstanceIdentifier.PathArgument, Object>> builder = getBuilder(pathArgument);
 
         if(deepestChild.isPresent()) {
@@ -63,6 +61,11 @@ abstract class InstanceIdToSimpleNodes<T extends YangInstanceIdentifier.PathArgu
         protected NormalizedNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, Object, LeafNode<Object>> getBuilder(final YangInstanceIdentifier.PathArgument node) {
             return Builders.leafBuilder().withNodeIdentifier(getIdentifier());
         }
+
+        @Override
+        boolean isMixin() {
+            return false;
+        }
     }
 
     static final class LeafListEntryNormalization extends InstanceIdToSimpleNodes<YangInstanceIdentifier.NodeWithValue> {
@@ -77,5 +80,9 @@ abstract class InstanceIdToSimpleNodes<T extends YangInstanceIdentifier.PathArgu
             return Builders.leafSetEntryBuilder().withNodeIdentifier((YangInstanceIdentifier.NodeWithValue) node).withValue(((YangInstanceIdentifier.NodeWithValue) node).getValue());
         }
 
+        @Override
+        boolean isMixin() {
+            return false;
+        }
     }
 }