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%2FNodeModification.java;h=04fb3b7c6c50499ad0b96b220c2685b597bdcb9d;hp=a0c15eb4a0590f2fe56f7008456a36ddc2dbba03;hb=e3b48885a28c9fe9f274bd30ec0246bdb246df8a;hpb=0897c90182109d6879a5455a4088593770cb8ac9 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java index a0c15eb4a0..04fb3b7c6c 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java @@ -12,6 +12,8 @@ import static com.google.common.base.Preconditions.checkState; import java.util.LinkedHashMap; import java.util.Map; +import javax.annotation.concurrent.GuardedBy; + import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -51,6 +53,7 @@ public class NodeModification implements StoreTreeNode, Identi private final Map childModification; + @GuardedBy("this") private boolean sealed = false; protected NodeModification(final PathArgument identifier, final Optional original) { @@ -173,6 +176,7 @@ public class NodeModification implements StoreTreeNode, Identi this.value = value; } + @GuardedBy("this") private void checkSealed() { checkState(!sealed, "Node Modification is sealed. No further changes allowed."); } @@ -202,7 +206,8 @@ public class NodeModification implements StoreTreeNode, Identi return !childModification.isEmpty(); } - public void updateModificationType(final ModificationType type) { + @GuardedBy("this") + private void updateModificationType(final ModificationType type) { modificationType = type; clearSnapshot(); }