- case DELETE:
- case NONE:
- // We need to record this delete.
- newType = LogicalOperation.DELETE;
- break;
- case MERGE:
- case TOUCH:
- case WRITE:
- /*
- * We are canceling a previous modification. This is a bit tricky,
- * as the original write may have just introduced the data, or it
- * may have modified it.
- *
- * As documented in BUG-2470, a delete of data introduced in this
- * transaction needs to be turned into a no-op.
- */
- newType = original.isPresent() ? LogicalOperation.DELETE : LogicalOperation.NONE;
- break;
- default:
- throw new IllegalStateException("Unhandled deletion of node with " + operation);
+ case DELETE:
+ case NONE:
+ // We need to record this delete.
+ newType = LogicalOperation.DELETE;
+ break;
+ case MERGE:
+ // In case of merge - delete needs to be recored and must not to be changed into NONE, because lazy
+ // expansion of parent MERGE node would reintroduce it again.
+ newType = LogicalOperation.DELETE;
+ break;
+ case TOUCH:
+ case WRITE:
+ /*
+ * We are canceling a previous modification. This is a bit tricky, as the original write may have just
+ * introduced the data, or it may have modified it.
+ *
+ * As documented in BUG-2470, a delete of data introduced in this transaction needs to be turned into
+ * a no-op.
+ */
+ newType = original.isPresent() ? LogicalOperation.DELETE : LogicalOperation.NONE;
+ break;
+ default:
+ throw new IllegalStateException("Unhandled deletion of node with " + operation);