- return;
- case DELETE:
- // Delete performs a data dependency check on existence of the node. Performing a merge on DELETE means we
- // are really performing a write. One thing that ruins that are any child modifications. If there are any,
- // we will perform a read() to get the current state of affairs, turn this into into a WRITE and then
- // append any child entries.
- if (!modification.getChildren().isEmpty()) {
- // Version does not matter here as we'll throw it out
- final Optional<TreeNode> current = apply(modification, modification.getOriginal(), Version.initial());
- if (current.isPresent()) {
- modification.updateValue(LogicalOperation.WRITE, current.get().getData());
- mergeChildrenIntoModification(modification, children, version);
- return;
+ return;
+ case DELETE:
+ // Delete performs a data dependency check on existence of the node. Performing a merge on DELETE means
+ // we are really performing a write. One thing that ruins that are any child modifications. If there
+ // are any, we will perform a read() to get the current state of affairs, turn this into into a WRITE
+ // and then append any child entries.
+ if (!modification.getChildren().isEmpty()) {
+ // Version does not matter here as we'll throw it out
+ final Optional<TreeNode> current = apply(modification, modification.getOriginal(),
+ Version.initial());
+ if (current.isPresent()) {
+ modification.updateValue(LogicalOperation.WRITE, current.get().getData());
+ mergeChildrenIntoModification(modification, children, version);
+ return;
+ }