Skip to content

Commit

Permalink
Handle one more special case. Fixes #216.
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored Jul 28, 2019
1 parent 27b51ae commit 95c57d6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions annotation-file-utilities/src/annotator/find/TreeFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,10 @@ public Void scan(Tree node, List<Insertion> p) {
if (parentKind == Tree.Kind.NEW_CLASS) {
continue;
}
IdentifierTree id = (IdentifierTree) node;
if (id.getName().contentEquals("this")) {
continue;
}
break;
default:
// TODO: make this switch statement exhaustive and check each case.
Expand Down
3 changes: 2 additions & 1 deletion annotation-file-utilities/tests/Issue216.goal
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
class Issue216 {
public class Issue216 {

Object value;
Object value2 = new Object();
Issue216 t = this;

@org.checkerframework.dataflow.qual.SideEffectFree
public Issue216() {}
Expand Down
2 changes: 0 additions & 2 deletions annotation-file-utilities/tests/Issue216.jaif
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ annotation @SideEffectFree: @java.lang.annotation.Retention(value=RUNTIME) @java
package :
class Issue216:

field value:

method <init>()V: @org.checkerframework.dataflow.qual.SideEffectFree
return:
3 changes: 2 additions & 1 deletion annotation-file-utilities/tests/Issue216.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
class Issue216 {
public class Issue216 {

Object value;
Object value2 = new Object();
Issue216 t = this;

public Issue216() {}
}

0 comments on commit 95c57d6

Please sign in to comment.