Skip to content

Commit a395347

Browse files
committed
rename: Construction -> construction.GumTreeDiff
1 parent fe54cce commit a395347

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/main/java/org/variantsync/diffdetective/experiments/thesis_bm/ConstructionValidation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import org.variantsync.diffdetective.util.IO;
3636
import org.variantsync.diffdetective.variation.DiffLinesLabel;
3737
import org.variantsync.diffdetective.variation.Label;
38-
import org.variantsync.diffdetective.variation.diff.Construction;
38+
import org.variantsync.diffdetective.variation.diff.construction.GumTreeDiff;
3939
import org.variantsync.diffdetective.variation.diff.DiffNode;
4040
import org.variantsync.diffdetective.variation.diff.VariationDiff;
4141
import org.variantsync.diffdetective.variation.diff.Projection;
@@ -59,8 +59,8 @@
5959
* This experiment computes the variation diff from
6060
* <ol>
6161
* <li>a line matching ({@link VariationDiffParser#createVariationDiff Viegener's algorithm}
62-
* <li>a tree matching computed by Gumtree ({@link Construction#diffUsingMatching}
63-
* <li>a hybrid matching ({@link Construction#improveMatching})
62+
* <li>a tree matching computed by Gumtree ({@link GumTreeDiff#diffUsingMatching}
63+
* <li>a hybrid matching ({@link GumTreeDiff#improveMatching})
6464
* </ol>
6565
* compares them using some quality metrics and stores timing statistics.
6666
*
@@ -291,7 +291,7 @@ public boolean analyzeVariationDiff(Analysis analysis) throws Exception, DiffPar
291291
afterVariationTree.assertConsistency();
292292

293293
clock.start();
294-
final DiffNode<DiffLinesLabel> newVariationDiffRoot = Construction.diffUsingMatching(
294+
final DiffNode<DiffLinesLabel> newVariationDiffRoot = GumTreeDiff.diffUsingMatching(
295295
beforeVariationTree.getRoot().projection(BEFORE),
296296
afterVariationTree.getRoot().projection(AFTER),
297297
augmentedMatcher(statistics.variationDiff[1])
@@ -304,7 +304,7 @@ public boolean analyzeVariationDiff(Analysis analysis) throws Exception, DiffPar
304304
final VariationDiff<DiffLinesLabel> improvedVariationDiff = analysis.getCurrentVariationDiff().deepCopy();
305305
improvedVariationDiff.assertConsistency();
306306
clock.start();
307-
Construction.improveMatching(improvedVariationDiff.getRoot(), augmentedMatcher(statistics.variationDiff[2]));
307+
GumTreeDiff.improveMatching(improvedVariationDiff.getRoot(), augmentedMatcher(statistics.variationDiff[2]));
308308
statistics.variationDiff[2].constructionDuration += clock.getPassedMilliseconds() - statistics.variationDiff[2].matchingDuration;
309309
improvedVariationDiff.assertConsistency();
310310

src/main/java/org/variantsync/diffdetective/variation/diff/Construction.java renamed to src/main/java/org/variantsync/diffdetective/variation/diff/construction/GumTreeDiff.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.variantsync.diffdetective.variation.diff;
1+
package org.variantsync.diffdetective.variation.diff.construction;
22

33
import com.github.gumtreediff.matchers.MappingStore;
44
import com.github.gumtreediff.matchers.Matcher;
@@ -10,6 +10,8 @@
1010
import org.variantsync.diffdetective.gumtree.VariationTreeAdapter;
1111
import org.variantsync.diffdetective.util.Assert;
1212
import org.variantsync.diffdetective.variation.Label;
13+
import org.variantsync.diffdetective.variation.diff.DiffNode;
14+
import org.variantsync.diffdetective.variation.diff.VariationDiff;
1315
import org.variantsync.diffdetective.variation.diff.source.VariationTreeDiffSource;
1416
import org.variantsync.diffdetective.variation.diff.traverse.VariationDiffTraversal;
1517
import org.variantsync.diffdetective.variation.tree.VariationNode;
@@ -25,7 +27,7 @@
2527
import static org.variantsync.diffdetective.variation.diff.Time.AFTER;
2628
import static org.variantsync.diffdetective.variation.diff.Time.BEFORE;
2729

28-
public class Construction {
30+
public class GumTreeDiff {
2931
/**
3032
* Create a {@link VariationDiff} by matching nodes between {@code before} and {@code after} with the
3133
* default GumTree matcher.

src/test/java/TreeDiffingTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.variantsync.diffdetective.feature.CPPAnnotationParser;
99
import org.variantsync.diffdetective.util.IO;
1010
import org.variantsync.diffdetective.variation.DiffLinesLabel;
11-
import org.variantsync.diffdetective.variation.diff.Construction;
11+
import org.variantsync.diffdetective.variation.diff.construction.GumTreeDiff;
1212
import org.variantsync.diffdetective.variation.diff.VariationDiff;
1313
import org.variantsync.diffdetective.variation.diff.parse.VariationDiffParseOptions;
1414
import org.variantsync.diffdetective.variation.diff.parse.VariationDiffParser;
@@ -80,7 +80,7 @@ public void testCase(TestCase testCase) throws IOException, DiffParseException {
8080
VariationTree<DiffLinesLabel> beforeEdit = parseVariationTree(testCase.beforeEdit());
8181
VariationTree<DiffLinesLabel> afterEdit = parseVariationTree(testCase.afterEdit());
8282

83-
VariationDiff<DiffLinesLabel> variationDiff = Construction.diffUsingMatching(beforeEdit, afterEdit);
83+
VariationDiff<DiffLinesLabel> variationDiff = GumTreeDiff.diffUsingMatching(beforeEdit, afterEdit);
8484

8585
try (var output = IO.newBufferedOutputStream(testCase.actual())) {
8686
new LineGraphExporter<>(new Format<>(new FullNodeFormat(), new ChildOrderEdgeFormat<>()))

0 commit comments

Comments
 (0)