Skip to content

Commit

Permalink
Do not skip AlsoNegation recipes; handle negation later
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Mar 7, 2024
1 parent 7b766b8 commit 626931d
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public class RefasterTemplateProcessor extends TypeAwareProcessor {
static final String BEFORE_TEMPLATE = "com.google.errorprone.refaster.annotation.BeforeTemplate";
static final String AFTER_TEMPLATE = "com.google.errorprone.refaster.annotation.AfterTemplate";
static Set<String> UNSUPPORTED_ANNOTATIONS = Stream.of(
"com.google.errorprone.refaster.annotation.AlsoNegation",
"com.google.errorprone.refaster.annotation.AllowCodeBetweenLines",
"com.google.errorprone.refaster.annotation.Matches",
"com.google.errorprone.refaster.annotation.MayOptionallyUse",
Expand Down Expand Up @@ -752,9 +751,8 @@ private boolean isAnyOfCall(JCTree.JCMethodInvocation call) {
JCTree.JCExpression meth = call.meth;
if (meth instanceof JCTree.JCFieldAccess) {
JCTree.JCFieldAccess fieldAccess = (JCTree.JCFieldAccess) meth;
if (fieldAccess.name.toString().equals("anyOf") && ((JCTree.JCIdent) fieldAccess.selected).name.toString().equals("Refaster")) {
return true;
}
return fieldAccess.name.toString().equals("anyOf") &&
((JCTree.JCIdent) fieldAccess.selected).name.toString().equals("Refaster");
}
return false;
}
Expand Down

0 comments on commit 626931d

Please sign in to comment.