X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fimpl%2Fschema%2Ftree%2FAbstractNodeContainerModificationStrategy.java;h=831c818647ff333b89366e02032f23126ae179ee;hb=e55154f0d2e8208ce1356ddbad281df343f3a508;hp=59ed52d04a9d242c3149a006b858233da2f21c13;hpb=f397c65a67e76abe9615a5d2152c381566a27414;p=yangtools.git diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractNodeContainerModificationStrategy.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractNodeContainerModificationStrategy.java index 59ed52d04a..831c818647 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractNodeContainerModificationStrategy.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractNodeContainerModificationStrategy.java @@ -8,7 +8,6 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import static com.google.common.base.Preconditions.checkArgument; - import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.base.Verify; @@ -282,7 +281,7 @@ abstract class AbstractNodeContainerModificationStrategy extends SchemaAwareAppl @Override protected void checkTouchApplicable(final YangInstanceIdentifier path, final NodeModification modification, - final Optional current) throws DataValidationFailedException { + final Optional current, final Version version) throws DataValidationFailedException { if (!modification.getOriginal().isPresent() && !current.isPresent()) { throw new ModifiedNodeDoesNotExistException(path, String.format("Node %s does not exist. Cannot apply modification to its children.", path)); } @@ -291,7 +290,7 @@ abstract class AbstractNodeContainerModificationStrategy extends SchemaAwareAppl throw new ConflictingModificationAppliedException(path, "Node was deleted by other transaction."); } - checkChildPreconditions(path, modification, current.get()); + checkChildPreconditions(path, modification, current.get(), version); } /** @@ -301,21 +300,22 @@ abstract class AbstractNodeContainerModificationStrategy extends SchemaAwareAppl * @param modification current modification * @param current Current data tree node. */ - private void checkChildPreconditions(final YangInstanceIdentifier path, final NodeModification modification, final TreeNode current) throws DataValidationFailedException { + private void checkChildPreconditions(final YangInstanceIdentifier path, final NodeModification modification, + final TreeNode current, final Version version) throws DataValidationFailedException { for (final NodeModification childMod : modification.getChildren()) { final YangInstanceIdentifier.PathArgument childId = childMod.getIdentifier(); final Optional childMeta = current.getChild(childId); final YangInstanceIdentifier childPath = path.node(childId); - resolveChildOperation(childId).checkApplicable(childPath, childMod, childMeta); + resolveChildOperation(childId).checkApplicable(childPath, childMod, childMeta, version); } } @Override protected void checkMergeApplicable(final YangInstanceIdentifier path, final NodeModification modification, - final Optional current) throws DataValidationFailedException { + final Optional current, final Version version) throws DataValidationFailedException { if (current.isPresent()) { - checkChildPreconditions(path, modification, current.get()); + checkChildPreconditions(path, modification, current.get(), version); } }