Skip to content

Commit ddb39d9

Browse files
committed
Rename compareUsingMatching to diffUsingMatching
1 parent a9009d3 commit ddb39d9

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/main/java/org/variantsync/diffdetective/validation/ConstructionValidation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* This experiment computes the variation diff from
5757
* <ol>
5858
* <li>a line matching ({@link DiffTreeParser#createDiffTree Viegener's algorithm}
59-
* <li>a tree matching computed by Gumtree ({@link DiffTree#compareUsingMatching}
59+
* <li>a tree matching computed by Gumtree ({@link DiffTree#diffUsingMatching}
6060
* <li>a hybrid matching ({@link DiffTree#improveMatching})
6161
* </ol>
6262
* compares them using some quality metrics and stores timing statistics.
@@ -288,7 +288,7 @@ public boolean analyzeDiffTree(Analysis analysis) throws Exception, DiffParseExc
288288
afterVariationTree.assertConsistency();
289289

290290
clock.start();
291-
final DiffNode newDiffTreeRoot = DiffTree.compareUsingMatching(
291+
final DiffNode newDiffTreeRoot = DiffTree.diffUsingMatching(
292292
beforeVariationTree.getRoot().projection(BEFORE),
293293
afterVariationTree.getRoot().projection(AFTER),
294294
augmentedMatcher(statistics.diffTree[1])

src/main/java/org/variantsync/diffdetective/variation/diff/DiffTree.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,10 @@ public String toString() {
466466
* Create a {@link DiffTree} by matching nodes between {@code before} and {@code after} with the
467467
* default GumTree matcher.
468468
*
469-
* @see compareUsingMatching(VariationNode, VariationNode, Matcher)
469+
* @see diffUsingMatching(VariationNode, VariationNode, Matcher)
470470
*/
471-
public static DiffTree compareUsingMatching(VariationTree before, VariationTree after) {
472-
DiffNode root = compareUsingMatching(
471+
public static DiffTree diffUsingMatching(VariationTree before, VariationTree after) {
472+
DiffNode root = diffUsingMatching(
473473
before.root(),
474474
after.root(),
475475
Matchers.getInstance().getMatcher()
@@ -481,19 +481,19 @@ public static DiffTree compareUsingMatching(VariationTree before, VariationTree
481481
/**
482482
* Create a {@link DiffNode} by matching nodes between {@code before} and {@code after} with
483483
* {@code matcher}. The arguments of this function aren't modified (note the
484-
* {@link compareUsingMatching(DiffNode, VariationNode, Matcher) overload} which modifies
484+
* {@link diffUsingMatching(DiffNode, VariationNode, Matcher) overload} which modifies
485485
* {@code before} in-place.
486486
*
487487
* @param before the variation tree before an edit
488488
* @param after the variation tree after an edit
489-
* @see compareUsingMatching(DiffNode, VariationNode, Matcher)
489+
* @see diffUsingMatching(DiffNode, VariationNode, Matcher)
490490
*/
491-
public static <A extends VariationNode<A>, B extends VariationNode<B>> DiffNode compareUsingMatching(
491+
public static <A extends VariationNode<A>, B extends VariationNode<B>> DiffNode diffUsingMatching(
492492
VariationNode<A> before,
493493
VariationNode<B> after,
494494
Matcher matcher
495495
) {
496-
return compareUsingMatching(DiffNode.unchanged(before), after, matcher);
496+
return diffUsingMatching(DiffNode.unchanged(before), after, matcher);
497497
}
498498

499499
/**
@@ -510,7 +510,7 @@ public static <A extends VariationNode<A>, B extends VariationNode<B>> DiffNode
510510
* @param after the variation tree after an edit
511511
* @see "Constructing Variation Diffs Using Tree Diffing Algorithms"
512512
*/
513-
public static <B extends VariationNode<B>> DiffNode compareUsingMatching(
513+
public static <B extends VariationNode<B>> DiffNode diffUsingMatching(
514514
DiffNode before,
515515
VariationNode<B> after,
516516
Matcher matcher
@@ -612,7 +612,7 @@ public void improveMatching(Matcher matcher) {
612612
* Run {@code matcher} on the matching extracted from {@code tree} and modify {@code tree}
613613
* in-place to reflect the new matching.
614614
*
615-
* This is equivalent to {@code compareUsingMatching} except that the existing implicit matching
615+
* This is equivalent to {@code diffUsingMatching} except that the existing implicit matching
616616
* is {@link extractMatching extracted} and used as basis for the new matching. Hence, this
617617
* method is mostly an optimisation to avoid a copy of the {@code AFTER} projection of {@code
618618
* tree}.

src/test/java/TreeDiffing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void testCase(TestCase testCase) throws IOException, DiffParseException {
7878
VariationTree beforeEdit = parseVariationTree(testCase.beforeEdit());
7979
VariationTree afterEdit = parseVariationTree(testCase.afterEdit());
8080

81-
DiffTree diffTree = DiffTree.compareUsingMatching(beforeEdit, afterEdit);
81+
DiffTree diffTree = DiffTree.diffUsingMatching(beforeEdit, afterEdit);
8282

8383
try (var output = IO.newBufferedOutputStream(testCase.actual())) {
8484
new LineGraphExporter(new Format(new FullNodeFormat(), new ChildOrderEdgeFormat()))

0 commit comments

Comments
 (0)