Skip to content

Commit 7ebde4d

Browse files
committed
rename: VariationTree::root() -> VariationTree::getRoot()
for consistency
1 parent 741dc20 commit 7ebde4d

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/main/java/org/variantsync/diffdetective/variation/diff/bad/BadVDiff.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ public EdgeToConstruct(
352352
final List<EdgeToConstruct<L>> edgesToConstruct = new ArrayList<>();
353353
final Map<VariationTreeNode<L>, DiffNode<L>> nodeTranslation = new HashMap<>();
354354

355-
final DiffNode<L> root = toGood(diff.root());
356-
nodeTranslation.put(diff.root(), root);
355+
final DiffNode<L> root = toGood(diff.getRoot());
356+
nodeTranslation.put(diff.getRoot(), root);
357357

358358
diff.forAllPreorder(vtnode -> {
359359
// If a node was already translated (because it was merged), it does not have to be translated anymore.
@@ -452,7 +452,7 @@ private void prettyPrint(final String indent, StringBuilder b, VariationTreeNode
452452

453453
public String prettyPrint() {
454454
final StringBuilder b = new StringBuilder();
455-
prettyPrint("", b, diff.root());
455+
prettyPrint("", b, diff.getRoot());
456456
return b.toString();
457457
}
458458

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public static <L extends Label> VariationDiff<L> diffUsingMatching(VariationTree
4343
*/
4444
public static <L extends Label> VariationDiff<L> diffUsingMatching(VariationTree<L> before, VariationTree<L> after, Matcher matcher) {
4545
DiffNode<L> root = diffUsingMatching(
46-
before.root(),
47-
after.root(),
46+
before.getRoot(),
47+
after.getRoot(),
4848
matcher
4949
);
5050

src/main/java/org/variantsync/diffdetective/variation/diff/view/DiffView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public static <L extends Label> VariationDiff<DiffLinesLabel> naive(final Variat
120120

121121
// TODO: Avoid inversion by building the map in the correct way in the first place.
122122
final Map<VariationTreeNode<L>, Projection<L>> invCopyMemory = CollectionUtils.invert(copyMemory, HashMap::new);
123-
TreeView.treeInline(treeView.root(), v -> inView.test(t, invCopyMemory.get(v)));
123+
TreeView.treeInline(treeView.getRoot(), v -> inView.test(t, invCopyMemory.get(v)));
124124

125125
projectionViewText[i] = treeView.unparse();
126126
}

src/main/java/org/variantsync/diffdetective/variation/tree/VariationTree.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public static <T extends VariationNode<T, L>, L extends Label> VariationTree<L>
140140

141141
public VariationDiff<L> toVariationDiff(final Function<VariationTreeNode<L>, DiffNode<L>> nodeConverter) {
142142
return new VariationDiff<>(
143-
DiffNode.unchanged(nodeConverter, root()),
143+
DiffNode.unchanged(nodeConverter, root),
144144
new CompositeSource("VariationTree.toVariationDiff", source)
145145
);
146146
}
@@ -176,7 +176,7 @@ public VariationTree<L> forAllPostorder(final Consumer<VariationTreeNode<L>> act
176176
* @return True iff the given condition returns true for at least one node in this tree.
177177
*/
178178
public boolean anyMatch(final Predicate<VariationTreeNode<L>> condition) {
179-
return root().anyMatch(condition);
179+
return root.anyMatch(condition);
180180
}
181181

182182
/**
@@ -218,7 +218,7 @@ public VariationTree<L> deepCopy(final Map<VariationTreeNode<L>, VariationTreeNo
218218

219219
public String unparse() {
220220
var result = new StringBuilder();
221-
root().unparse(result);
221+
root.unparse(result);
222222
return result.toString();
223223
}
224224

@@ -233,7 +233,7 @@ public void assertConsistency() {
233233
forAllPreorder(VariationTreeNode::assertConsistency);
234234
}
235235

236-
public VariationTreeNode<L> root() {
236+
public VariationTreeNode<L> getRoot() {
237237
return root;
238238
}
239239

src/main/java/org/variantsync/diffdetective/variation/tree/view/TreeView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ private TreeView() {}
5555
*/
5656
public static <L extends Label> void treeInline(final VariationTree<L> t, final Relevance r) {
5757
final Set<VariationTreeNode<L>> interestingNodes = new HashSet<>();
58-
r.computeViewNodes(t.root(), interestingNodes::add);
59-
treeInline(t.root(), interestingNodes::contains);
58+
r.computeViewNodes(t.getRoot(), interestingNodes::add);
59+
treeInline(t.getRoot(), interestingNodes::contains);
6060
t.setSource(new ViewSource(t.getSource(), r, "view_tree"));
6161
}
6262

0 commit comments

Comments
 (0)