Bug 4295: Fixed incorrectly introduced nodes when MERGE was followed by DELETE 19/33119/1
authorTony Tkacik <ttkacik@cisco.com>
Wed, 20 Jan 2016 17:20:32 +0000 (18:20 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Wed, 20 Jan 2016 17:24:41 +0000 (17:24 +0000)
ModificationNode lost state in situations when
parent node was MERGE which indroduced child nodes
and child node was deleted. That resulted into recording NONE,
which during apply of MERGE was expanded back to original MERGE
which caused reintroduction of deleted node.

Change-Id: Ia2085f5475b49957ef8ac7ab6c629ca3eef803f2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModifiedNode.java

index cae3e94d1c7bdd7aa2dc5a5550cb2e2b0d8166dd..be0ed682adf111f79b9148bdfdb4953fc5045dcc 100644 (file)
@@ -221,6 +221,11 @@ final class ModifiedNode extends NodeModification implements StoreTreeNode<Modif
             newType = LogicalOperation.DELETE;
             break;
         case MERGE:
+                // In case of merge - delete needs to be recored and must not to be changed into
+                // NONE, because lazy expansion of parent MERGE node would reintroduce it
+                // again.
+                newType = LogicalOperation.DELETE;
+                break;
         case TOUCH:
         case WRITE:
             /*