X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2Ftree%2Fdata%2FValueNodeModificationStrategy.java;h=900fa320a167838a8d04155becb2096385dfaaed;hp=5f68782a2e70a309abfff0ff2b99c5a1321b6fce;hb=b6e3e11ddcea90a2ae7f93c179625941e8e22ccd;hpb=aefe82b158bc1694fe633053d04f2364bcbe67d9 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/ValueNodeModificationStrategy.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/ValueNodeModificationStrategy.java index 5f68782a2e..900fa320a1 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/ValueNodeModificationStrategy.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/ValueNodeModificationStrategy.java @@ -9,7 +9,7 @@ package org.opendaylight.controller.md.sal.dom.store.impl.tree.data; import static com.google.common.base.Preconditions.checkArgument; -import org.opendaylight.controller.md.sal.dom.store.impl.tree.DataPreconditionFailedException; +import org.opendaylight.controller.md.sal.dom.store.impl.tree.IncorrectDataStructureException; import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.TreeNode; import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.TreeNodeFactory; import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.Version; @@ -48,28 +48,28 @@ abstract class ValueNodeModificationStrategy extends S @Override protected TreeNode applySubtreeChange(final ModifiedNode modification, - final TreeNode currentMeta, final Version subtreeVersion) { + final TreeNode currentMeta, final Version version) { throw new UnsupportedOperationException("Node " + schema.getPath() + "is leaf type node. Subtree change is not allowed."); } @Override protected TreeNode applyMerge(final ModifiedNode modification, final TreeNode currentMeta, - final Version subtreeVersion) { + final Version version) { // Just overwrite whatever was there - return applyWrite(modification, null, subtreeVersion); + return applyWrite(modification, null, version); } @Override protected TreeNode applyWrite(final ModifiedNode modification, - final Optional currentMeta, final Version subtreeVersion) { - return TreeNodeFactory.createTreeNode(modification.getWrittenValue(), subtreeVersion); + final Optional currentMeta, final Version version) { + return TreeNodeFactory.createTreeNode(modification.getWrittenValue(), version); } @Override protected void checkSubtreeModificationApplicable(final InstanceIdentifier path, final NodeModification modification, - final Optional current) throws DataPreconditionFailedException { - throw new DataPreconditionFailedException(path, "Subtree modification is not allowed."); + final Optional current) throws IncorrectDataStructureException { + throw new IncorrectDataStructureException(path, "Subtree modification is not allowed."); } public static class LeafSetEntryModificationStrategy extends ValueNodeModificationStrategy {