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=50ef3b0b7edc93b2c13ea1285c82d5bee6f7def5;hb=refs%2Fchanges%2F01%2F93901%2F1;hp=342745b735999cb1266d5b9b07b22f7601d89d59;hpb=45f1165595431a54440f7b63542bb5f4ce507d5d;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 342745b735..50ef3b0b7e 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 @@ -172,20 +172,18 @@ abstract class AbstractNodeContainerModificationStrategy } /* - * This is where things get interesting. The user has performed a write and - * then she applied some more modifications to it. So we need to make sense - * of that an apply the operations on top of the written value. We could have - * done it during the write, but this operation is potentially expensive, so - * we have left it out of the fast path. + * This is where things get interesting. The user has performed a write and then she applied some more + * modifications to it. So we need to make sense of that and apply the operations on top of the written value. * - * As it turns out, once we materialize the written data, we can share the - * code path with the subtree change. So let's create an unsealed TreeNode - * and run the common parts on it -- which end with the node being sealed. + * We could have done it during the write, but this operation is potentially expensive, so we have left it out + * of the fast path. * - * FIXME: this code needs to be moved out from the prepare() path and into - * the read() and seal() paths. Merging of writes needs to be charged - * to the code which originated this, not to the code which is - * attempting to make it visible. + * As it turns out, once we materialize the written data, we can share the code path with the subtree change. So + * let's create an unsealed TreeNode and run the common parts on it -- which end with the node being sealed. + * + * FIXME: this code needs to be moved out from the prepare() path and into the read() and seal() paths. Merging + * of writes needs to be charged to the code which originated this, not to the code which is attempting + * to make it visible. */ final MutableTreeNode mutable = newValueMeta.mutable(); mutable.setSubtreeVersion(version); @@ -274,12 +272,10 @@ abstract class AbstractNodeContainerModificationStrategy case TOUCH: mergeChildrenIntoModification(modification, children, version); - // We record empty merge value, since real children merges - // are already expanded. This is needed to satisfy non-null for merge - // original merge value can not be used since it mean different - // order of operation - parent changes are always resolved before - // children ones, and having node in TOUCH means children was modified - // before. + // We record empty merge value, since real children merges are already expanded. This is needed to + // satisfy non-null for merge original merge value can not be used since it mean different order of + // operation - parent changes are always resolved before children ones, and having node in TOUCH means + // children was modified before. modification.updateValue(LogicalOperation.MERGE, support.createEmptyValue(value)); return; case MERGE: @@ -320,9 +316,11 @@ abstract class AbstractNodeContainerModificationStrategy @Override protected TreeNode applyTouch(final ModifiedNode modification, final TreeNode currentMeta, final Version version) { /* - * The user may have issued an empty merge operation. In this case we do not perform - * a data tree mutation, do not pass GO, and do not collect useless garbage. It - * also means the ModificationType is UNMODIFIED. + * The user may have issued an empty merge operation. In this case we: + * - do not perform a data tree mutation + * - do not pass GO, and + * - do not collect useless garbage. + * It also means the ModificationType is UNMODIFIED. */ final Collection children = modification.getChildren(); if (!children.isEmpty()) { @@ -333,12 +331,12 @@ abstract class AbstractNodeContainerModificationStrategy final TreeNode ret = mutateChildren(newMeta, dataBuilder, version, children); /* - * It is possible that the only modifications under this node were empty merges, - * which were turned into UNMODIFIED. If that is the case, we can turn this operation - * into UNMODIFIED, too, potentially cascading it up to root. This has the benefit - * of speeding up any users, who can skip processing child nodes. + * It is possible that the only modifications under this node were empty merges, which were turned into + * UNMODIFIED. If that is the case, we can turn this operation into UNMODIFIED, too, potentially cascading + * it up to root. This has the benefit of speeding up any users, who can skip processing child nodes. * * In order to do that, though, we have to check all child operations are UNMODIFIED. + * * Let's do precisely that, stopping as soon we find a different result. */ for (final ModifiedNode child : children) {