@@ -203,7 +203,7 @@ public static <L extends Label> DiffNode<L> improveMatching(DiffNode<L> tree, Ma
203203 var beforeNode = Cast .<Tree , VariationDiffAdapter <L >>unchecked (srcNode ).getDiffNode ();
204204 if (dstNode == null || !srcNode .getLabel ().equals (dstNode .getLabel ())) {
205205 if (beforeNode .isNon ()) {
206- splitNode ( beforeNode );
206+ beforeNode . split ( AFTER );
207207 }
208208
209209 Assert .assertTrue (beforeNode .isRem ());
@@ -212,10 +212,10 @@ public static <L extends Label> DiffNode<L> improveMatching(DiffNode<L> tree, Ma
212212
213213 if (beforeNode != afterNode ) {
214214 if (beforeNode .isNon ()) {
215- splitNode ( beforeNode );
215+ beforeNode . split ( AFTER );
216216 }
217217 if (afterNode .isNon ()) {
218- afterNode = splitNode ( afterNode );
218+ afterNode . split ( BEFORE );
219219 }
220220
221221 joinNode (beforeNode , afterNode );
@@ -229,37 +229,6 @@ public static <L extends Label> DiffNode<L> improveMatching(DiffNode<L> tree, Ma
229229 return tree ;
230230 }
231231
232- /**
233- * Removes the implicit matching between the {@code BEFORE} and {@code AFTER} projection of
234- * {@code beforeNode}. This is achieved by copying {@code beforeNode} and reconnecting all
235- * necessary edges such that the new node exists only after and {@code beforeNode} only exists
236- * before the edit.
237- *
238- * This method doesn't change the {@code BEFORE} and {@code AFTER} projection of {@code
239- * beforeNode}.
240- *
241- * @param beforeNode the node to be split
242- * @return a copy of {@code beforeNode} existing only after the edit.
243- */
244- private static <L extends Label > DiffNode <L > splitNode (DiffNode <L > beforeNode ) {
245- Assert .assertTrue (beforeNode .isNon ());
246-
247- DiffNode <L > afterNode = beforeNode .shallowCopy ();
248-
249- afterNode .diffType = ADD ;
250- beforeNode .diffType = REM ;
251-
252- afterNode .addChildren (beforeNode .removeChildren (AFTER ), AFTER );
253- var afterParent = beforeNode .getParent (AFTER );
254- afterParent .insertChild (afterNode , afterParent .indexOfChild (beforeNode , AFTER ), AFTER );
255- beforeNode .drop (AFTER );
256-
257- beforeNode .assertConsistency ();
258- afterNode .assertConsistency ();
259-
260- return afterNode ;
261- }
262-
263232 /**
264233 * Merges {@code afterNode} into {@code beforeNode} such that {@code beforeNode.isNon() ==
265234 * true}. Essentially, an implicit matching is inserted between {@code beforeNode} and {@code
0 commit comments