Merge "Removed unused code from md-sal."
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / util / YangDataOperations.xtend
index f37fb0e5c03e1743b3fefa34ba454ccbe0668d89..1e89281df498b34d82bea1f3e6b08574c0941a06 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.sal.dom.broker.util
 
 import org.opendaylight.yangtools.yang.data.api.CompositeNode
@@ -63,7 +70,7 @@ class YangDataOperations {
         
         if(node.keyDefinition === null || node.keyDefinition.empty) {
             return modified;
-        } 
+        }
         val originalMap = (original as List).toIndexMap(node.keyDefinition);
         val modifiedMap = (modified as List).toIndexMap(node.keyDefinition);
         
@@ -73,7 +80,8 @@ class YangDataOperations {
             if(originalEntry != null) {
                 originalMap.remove(entry.key);
                 mergedNodes.add(merge(node,originalEntry,entry.value,configurational));
-                
+            } else {
+                mergedNodes.add(entry.value);
             }
         }
         mergedNodes.addAll(originalMap.values);