Skip to content

Commit 2ec8eb6

Browse files
committed
Tweak AbstractMatcherTestChecker
Refaster template parameters will never match only the identifier of a method's receiver parameter, so for the purpose of testing `@Matches` and `@NotMatches` predicate classes, there's no need to descend into `VariableTree#getNameExpression()`. See https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.4
1 parent 7b12217 commit 2ec8eb6

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

refaster-support/src/test/java/tech/picnic/errorprone/refaster/matchers/AbstractMatcherTestChecker.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public Description matchCompilationUnit(CompilationUnitTree compilationUnit, Vis
8484
* variable declaration. While the latter can be `ExpressionTree`s, they will never be
8585
* matched by Refaster.
8686
*/
87-
scan(tree.getNameExpression(), null);
8887
scan(tree.getInitializer(), null);
8988
return null;
9089
}

0 commit comments

Comments
 (0)