Skip to content

Commit caa6dfc

Browse files
committed
Fix the Javadoc errors introduced by thesis_bm
1 parent 57dd139 commit caa6dfc

4 files changed

Lines changed: 30 additions & 12 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ public int getChangeAmount(Time time) {
286286
* Inverse of drop.
287287
* @param newBeforeParent Node that should be this node's before parent. May be null.
288288
* @param newAfterParent Node that should be this node's after parent. May be null.
289-
* @return True iff this node could be added as child to at least one of the given non-null parents.
290289
*/
291290
public void addBelow(final DiffNode newBeforeParent, final DiffNode newAfterParent) {
292291
if (getDiffType().existsAtTime(BEFORE) && newBeforeParent != null) {
@@ -367,7 +366,6 @@ public void addChildren(final Collection<DiffNode> children, Time time) {
367366
* The node might still remain a child after or before the edit.
368367
* @param child the child to remove
369368
* @param time whether {@code child} should be removed before or after the edit
370-
* @return True iff the child was removed, false iff it's not a child at {@code time}.
371369
*/
372370
public void removeChild(final DiffNode child, Time time) {
373371
Assert.assertTrue(isChild(child, time));

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

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ public String toString() {
494494
* Create a {@link DiffTree} by matching nodes between {@code before} and {@code after} with the
495495
* default GumTree matcher.
496496
*
497-
* @see compareUsingMatching(VariationTree, VariationTree, Matcher)
497+
* @see compareUsingMatching(VariationNode, VariationNode, Matcher)
498498
*/
499499
public static DiffTree compareUsingMatching(VariationTree before, VariationTree after) {
500500
DiffNode root = compareUsingMatching(
@@ -507,13 +507,14 @@ public static DiffTree compareUsingMatching(VariationTree before, VariationTree
507507
}
508508

509509
/**
510-
* Create a {@link DiffTree} by matching nodes between {@code before} and {@code after} with
511-
* {@code matcher}.
510+
* Create a {@link DiffNode} by matching nodes between {@code before} and {@code after} with
511+
* {@code matcher}. The arguments of this function aren't modified (note the
512+
* {@link compareUsingMatching(DiffNode, VariationNode, Matcher) overload} which modifies
513+
* {@code before} in-place.
512514
*
513-
* Note: There are currently no guarantees about the line numbers. But it is guaranteed that
514-
* {@link DiffNode#getID} is unique.
515-
*
516-
* @param TODO
515+
* @param before the variation tree before an edit
516+
* @param after the variation tree after an edit
517+
* @see compareUsingMatching(DiffNode, VariationNode, Matcher)
517518
*/
518519
public static <A extends VariationNode<A>, B extends VariationNode<B>> DiffNode compareUsingMatching(
519520
VariationNode<A> before,
@@ -523,6 +524,17 @@ public static <A extends VariationNode<A>, B extends VariationNode<B>> DiffNode
523524
return compareUsingMatching(DiffNode.unchanged(before), after, matcher);
524525
}
525526

527+
/**
528+
* Create a {@link DiffNode} by matching nodes between {@code before} and {@code after} with
529+
* {@code matcher}. The result of this function is {@code before} which is modified in-place. In
530+
* contrast, {@code after} is kept in tact.
531+
*
532+
* Note: There are currently no guarantees about the line numbers. But it is guaranteed that
533+
* {@link DiffNode#getID} is unique.
534+
*
535+
* @param before the variation tree before an edit
536+
* @param after the variation tree after an edit
537+
*/
526538
public static <B extends VariationNode<B>> DiffNode compareUsingMatching(
527539
DiffNode before,
528540
VariationNode<B> after,
@@ -591,10 +603,18 @@ private static void addUnmapped(MappingStore mappings, DiffNode parent, WrappedV
591603
}
592604
}
593605

606+
/**
607+
* Run {@code matcher} on the implicit matching of this variation diff and update this variation
608+
* tree in-place to reflect the new matching.
609+
*/
594610
public void improveMatching(Matcher matcher) {
595611
improveMatching(getRoot(), matcher);
596612
}
597613

614+
/**
615+
* Run {@code matcher} on the matching extracted from {@code tree} and modify {@code tree}
616+
* in-place to reflect the new matching.
617+
*/
598618
public static DiffNode improveMatching(DiffNode tree, Matcher matcher) {
599619
var src = new WrappedDiffTree(tree, BEFORE);
600620
var dst = new WrappedDiffTree(tree, AFTER);

src/main/java/org/variantsync/diffdetective/variation/diff/source/VariationTreeDiffSource.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package org.variantsync.diffdetective.variation.diff.source;
22

3+
import org.variantsync.diffdetective.variation.diff.DiffTree; // For Javadoc
4+
import org.variantsync.diffdetective.variation.tree.VariationTree; // For Javadoc
35
import org.variantsync.diffdetective.variation.tree.source.VariationTreeSource;
46

57
/**
6-
* Describes that a {@link DiffTree} was created from two {@link VarationTree}s.
8+
* Describes that a {@link DiffTree} was created from two {@link VariationTree}s.
79
*/
810
public record VariationTreeDiffSource(
911
VariationTreeSource before,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,6 @@ public void addChildren(final Collection<T> children) {
238238
* Removes the given node from this node's children list and sets the parent of {@code child}
239239
* to {@code null}.
240240
*
241-
* @return {@code true} iff the child was removed, {@code false} iff {@code child} is not a
242-
* child of this node
243241
* @throws IllegalArgumentException if {@code childe} is not a child of this node
244242
* @see removeChildren
245243
* @see getChildren

0 commit comments

Comments
 (0)