Skip to content

Commit 97433b8

Browse files
committed
clean up
1 parent 9bc7ae0 commit 97433b8

6 files changed

Lines changed: 8 additions & 36 deletions

File tree

src/main/java/org/variantsync/diffdetective/shell/ShellExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public List<String> execute(ShellCommand command, Path executionDir) throws Shel
100100
List<String> output = new LinkedList<>();
101101
Consumer<String> shareOutput = s -> {
102102
output.add(s);
103-
// outputReader.accept(s);
103+
outputReader.accept(s);
104104
};
105105
try {
106106
process = builder.start();

src/main/java/org/variantsync/diffdetective/util/StringUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static String prettyPrintNestedCollections(final Collection<?> collection
4848
public static String clamp(int maxlen, String s) {
4949
return s.substring(0, Math.min(s.length(), maxlen));
5050
}
51-
51+
5252
/**
5353
* @return the longest prefix of the given string that contains only of whitespace
5454
*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ public static <T extends VariationNode<T, L>, L extends Label> DiffNode<L> uncha
823823
variationNode.getLabel()
824824
);
825825
}
826-
826+
827827
/**
828828
* Transforms a {@code VariationNode} into a {@code DiffNode} by diffing {@code variationNode}
829829
* to itself. Recursively translates all children.
@@ -846,7 +846,7 @@ public static <T extends VariationNode<T, L1>, L1 extends Label, L2 extends Labe
846846

847847
return diffNode;
848848
}
849-
849+
850850
public DiffNode<L> deepCopy() {
851851
return deepCopy(new HashMap<>());
852852
}
@@ -948,7 +948,7 @@ public void makeUnchanged() {
948948
public static <T extends VariationNode<T, L>, L extends Label> DiffNode<L> unchanged(VariationNode<T, L> variationNode) {
949949
return unchanged(DiffNode::unchangedFlat, variationNode);
950950
}
951-
951+
952952
/**
953953
* Returns true if this subtree is exactly equal to {@code other}.
954954
* This check uses equality checks instead of identity.

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@
3535
import java.util.ArrayList;
3636
import java.util.HashMap;
3737
import java.util.LinkedHashSet;
38-
import java.util.HashSet;
3938
import java.util.List;
4039
import java.util.Map;
41-
import java.util.Set;
4240
import java.util.concurrent.atomic.AtomicBoolean;
4341
import java.util.concurrent.atomic.AtomicInteger;
4442
import java.util.function.Consumer;
@@ -375,24 +373,6 @@ public int count(final Predicate<DiffNode<L>> nodesToCount) {
375373
return count.get();
376374
}
377375

378-
379-
// /**
380-
// * Returns all variable names occurring in annotations (i.e., formulas of mapping nodes) in this variation diff.
381-
// * @return A set of every occuring feature name.
382-
// */
383-
// public Set<String> computeAllFeatureNames() {
384-
// Set<String> features = new LinkedHashSet<>();
385-
// forAll(node -> {
386-
// if (node.isConditionalAnnotation()) {
387-
// features.addAll(node.getFormula().getUniqueContainedFeatures());
388-
// }
389-
// });
390-
// // Since FeatureIDE falsely reports constants "True" and "False" as feature names, we have to remove them from the resulting set.
391-
// features.removeIf(FixTrueFalse::isTrueLiteral);
392-
// features.removeIf(FixTrueFalse::isFalseLiteral);
393-
// return features;
394-
// }
395-
396376
/**
397377
* Returns all variable names occurring in annotations (i.e., formulas of mapping nodes) in this variation diff.
398378
* This method is deterministic: It will return the feature names always in the same order, assuming the variation diff is not changed inbetween.

src/main/java/org/variantsync/diffdetective/variation/diff/transform/EliminateEmptyAlternatives.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import org.variantsync.diffdetective.variation.tree.VariationTree;
1010
import org.variantsync.diffdetective.variation.tree.VariationTreeNode;
1111

12-
import java.util.ArrayList;
1312
import java.util.List;
1413

1514
import static org.variantsync.diffdetective.util.fide.FormulaUtils.*;
@@ -80,8 +79,7 @@ private static void elim(VariationTreeNode<DiffLinesLabel> subtree) {
8079

8180
// When there are no children, 'subtree' is an empty annotation that can be eliminated.
8281
if (children.isEmpty()) {
83-
// subtree.drop();
84-
nodesToDrop.add(subtree);
82+
subtree.drop();
8583
}
8684
// When there is exactly one child and that child is an 'else' or 'elif' we can simplify that nesting.
8785
else if (children.size() == 1) {
@@ -97,8 +95,7 @@ else if (children.size() == 1) {
9795
subtree.setLabel(updatedLabel(subtree.getLabel(), newFormula));
9896

9997
// simplify tree
100-
// child.drop();
101-
nodesToDrop.add(child);
98+
child.drop();
10299
subtree.stealChildrenOf(child);
103100
}
104101
}

src/main/java/org/variantsync/diffdetective/variation/tree/view/relevance/Configure.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
import org.variantsync.diffdetective.variation.tree.VariationNode;
1515
import org.variantsync.diffdetective.variation.tree.view.relevance.spec.ConfigureSpec;
1616

17-
import java.util.List;
18-
import java.util.Map;
19-
import java.util.Map.Entry;
20-
import java.util.function.Consumer;
21-
2217
/**
2318
* Relevance predicate that generates (partial) variants from variation trees.
2419
* This relevance predicate is the implementation of Equation 5 in our SPLC'23 paper.
@@ -64,7 +59,7 @@ public Configure(final Node configuration) {
6459
* then we construct a formula A ∧ (¬ B) ∧ C.
6560
*/
6661
public Configure(final Map<String, Boolean> assignment) {
67-
// We use commutativity if ∧ to iterate the map only once instead of twice as shown in the formula above.
62+
// We use commutativity of ∧ to iterate the map only once instead of twice as shown in the formula above.
6863
final Formula[] fixedFeatures = new Formula[assignment.size()];
6964
int i = 0;
7065
for (Entry<String, Boolean> entry : assignment.entrySet()) {

0 commit comments

Comments
 (0)