BUG-4295: handle merge into unkeyed list 72/33472/2
authorRobert Varga <rovarga@cisco.com>
Mon, 25 Jan 2016 09:58:55 +0000 (10:58 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 25 Jan 2016 12:21:08 +0000 (12:21 +0000)
A merge into an unkeyed list equals to a write.

Change-Id: Iaded1cab2bdf38ee9595ebfe579dbb566b2beae4
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit a88bcb677187ed7a687890c33d24c2c7fe224c54)

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

index dacba5aefe3b295d08f1bd565be5be61f677b077..d93d4971d1b12d09bc0ace4355d723a8a346d5ff 100644 (file)
@@ -38,7 +38,8 @@ final class UnkeyedListModificationStrategy extends SchemaAwareApplyOperation {
 
     @Override
     protected TreeNode applyMerge(final ModifiedNode modification, final TreeNode currentMeta, final Version version) {
-        throw new IllegalStateException("Invalid merge into unkeyed list");
+        // A merge operation is promoted into a write
+        return applyWrite(modification, Optional.of(currentMeta), version);
     }
 
     @Override