@@ -189,7 +189,7 @@ public static <L extends Label> DiffNode<L> improveMatching(DiffNode<L> tree, Ma
189189 var beforeNode = Cast .<Tree , VariationDiffAdapter <L >>unchecked (srcNode ).getDiffNode ();
190190 if (dstNode == null || !srcNode .getLabel ().equals (dstNode .getLabel ())) {
191191 if (beforeNode .isNon ()) {
192- splitNode ( beforeNode );
192+ beforeNode . split ( AFTER );
193193 }
194194
195195 Assert .assertTrue (beforeNode .isRem ());
@@ -198,10 +198,10 @@ public static <L extends Label> DiffNode<L> improveMatching(DiffNode<L> tree, Ma
198198
199199 if (beforeNode != afterNode ) {
200200 if (beforeNode .isNon ()) {
201- splitNode ( beforeNode );
201+ beforeNode . split ( AFTER );
202202 }
203203 if (afterNode .isNon ()) {
204- afterNode = splitNode ( afterNode );
204+ afterNode . split ( BEFORE );
205205 }
206206
207207 joinNode (beforeNode , afterNode );
@@ -215,37 +215,6 @@ public static <L extends Label> DiffNode<L> improveMatching(DiffNode<L> tree, Ma
215215 return tree ;
216216 }
217217
218- /**
219- * Removes the implicit matching between the {@code BEFORE} and {@code AFTER} projection of
220- * {@code beforeNode}. This is achieved by copying {@code beforeNode} and reconnecting all
221- * necessary edges such that the new node exists only after and {@code beforeNode} only exists
222- * before the edit.
223- *
224- * This method doesn't change the {@code BEFORE} and {@code AFTER} projection of {@code
225- * beforeNode}.
226- *
227- * @param beforeNode the node to be split
228- * @return a copy of {@code beforeNode} existing only after the edit.
229- */
230- private static <L extends Label > DiffNode <L > splitNode (DiffNode <L > beforeNode ) {
231- Assert .assertTrue (beforeNode .isNon ());
232-
233- DiffNode <L > afterNode = beforeNode .shallowCopy ();
234-
235- afterNode .diffType = ADD ;
236- beforeNode .diffType = REM ;
237-
238- afterNode .addChildren (beforeNode .removeChildren (AFTER ), AFTER );
239- var afterParent = beforeNode .getParent (AFTER );
240- afterParent .insertChild (afterNode , afterParent .indexOfChild (beforeNode , AFTER ), AFTER );
241- beforeNode .drop (AFTER );
242-
243- beforeNode .assertConsistency ();
244- afterNode .assertConsistency ();
245-
246- return afterNode ;
247- }
248-
249218 /**
250219 * Merges {@code afterNode} into {@code beforeNode} such that {@code beforeNode.isNon() ==
251220 * true}. Essentially, an implicit matching is inserted between {@code beforeNode} and {@code
0 commit comments