Skip to content

Commit aa53e26

Browse files
authored
Remove unused assignments
1 parent 486e722 commit aa53e26

6 files changed

Lines changed: 25 additions & 24 deletions

File tree

SKIP-REQUIRE-JAVADOC

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Delete this file

annotation-file-utilities/src/main/java/org/checkerframework/afu/annotator/find/GenericArrayLocationCriterion.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ && isSatisfiedBy(
283283
if (leaf instanceof ParameterizedTypeTree) {
284284
leaf = parent;
285285
parentPath = parentPath.getParentPath();
286-
parent = parentPath.getLeaf();
287286
}
288287
if (!(leaf instanceof MemberSelectTree)) {
289288
return false;
@@ -294,7 +293,6 @@ && isSatisfiedBy(
294293
return false;
295294
}
296295
locationRemaining.remove(locationRemaining.size() - 1);
297-
leaf = fieldAccess.selected;
298296
pathRemaining = parentPath;
299297
// TreePath.getPath(pathRemaining.getCompilationUnit(), leaf);
300298
} else if (loc.step == TypePath.WILDCARD_BOUND

annotation-file-utilities/src/main/java/org/checkerframework/afu/annotator/find/Insertions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,6 @@ private Set<Insertion> organizeTypedInsertions(
516516
default:
517517
break;
518518
}
519-
path = path.getParentPath();
520519
}
521520
}
522521

annotation-file-utilities/src/main/java/org/checkerframework/afu/annotator/scanner/InstanceOfScanner.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,6 @@
1616
*/
1717
public class InstanceOfScanner extends CommonScanner {
1818

19-
/**
20-
* Computes the index of the given instanceof tree amongst all instanceof tree inside its method,
21-
* using 0-based indexing.
22-
*
23-
* @param origpath the path ending in the given instanceof tree
24-
* @param tree the instanceof tree to search for
25-
* @return the index of the given instanceof tree
26-
*/
27-
public static int indexOfInstanceOfTree(TreePath origpath, Tree tree) {
28-
TreePath path = TreePathUtil.findCountingContext(origpath);
29-
if (path == null) {
30-
return -1;
31-
}
32-
33-
InstanceOfScanner ios = new InstanceOfScanner(tree);
34-
ios.scan(path, null);
35-
return ios.index;
36-
}
37-
3819
private int index = -1;
3920
private boolean done = false;
4021
private final Tree tree;
@@ -61,6 +42,25 @@ public Void visitInstanceOf(InstanceOfTree node, Void p) {
6142
return super.visitInstanceOf(node, null);
6243
}
6344

45+
/**
46+
* Computes the index of the given instanceof tree amongst all instanceof tree inside its method,
47+
* using 0-based indexing.
48+
*
49+
* @param origpath the path ending in the given instanceof tree
50+
* @param tree the instanceof tree to search for
51+
* @return the index of the given instanceof tree
52+
*/
53+
public static int indexOfInstanceOfTree(TreePath origpath, Tree tree) {
54+
TreePath path = TreePathUtil.findCountingContext(origpath);
55+
if (path == null) {
56+
return -1;
57+
}
58+
59+
InstanceOfScanner ios = new InstanceOfScanner(tree);
60+
ios.scan(path, null);
61+
return ios.index;
62+
}
63+
6464
// Map from name of a method to a list of bytecode offsets of all
6565
// instanceof checks in that method.
6666
private static Map<String, List<Integer>> methodNameToInstanceOfOffsets = new HashMap<>();

annotation-file-utilities/src/main/java/org/checkerframework/afu/scenelib/el/AScene.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,10 @@ public static void main(String[] args) {
408408
System.out.print(args[i] + ": ");
409409
try {
410410
IndexFileParser.parseFile(args[i], s0);
411-
@SuppressWarnings("UnusedVariable") // testing that clone() does not throw an exception
411+
@SuppressWarnings({
412+
"UnusedVariable",
413+
"PMD.UnusedLocalVariable"
414+
}) // testing that clone() does not throw an exception
412415
AScene ignore = s0.clone();
413416
System.out.println("ok");
414417
} catch (Throwable e) {

dataflow/src/main/java/org/checkerframework/dataflow/cfg/ControlFlowGraph.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ public String toStringDebug() {
465465
if (astString.length() > 65) {
466466
astString = "\"" + astString.substring(0, 60) + "\"";
467467
}
468-
result.add("underlyingAST=" + underlyingAST);
468+
result.add("underlyingAST=" + astString);
469469
result.add("treeLookup=" + AnalysisResult.treeLookupToString(treeLookup));
470470
result.add("convertedTreeLookup=" + AnalysisResult.treeLookupToString(convertedTreeLookup));
471471
result.add("postfixLookup=" + postfixNodeLookup);

0 commit comments

Comments
 (0)