Skip to content

Commit

Permalink
Tolerate @DoNotCall with no action taken
Browse files Browse the repository at this point in the history
As discussed on #47
  • Loading branch information
timtebeek committed Dec 17, 2023
1 parent e141e81 commit c758a24
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ public class RefasterTemplateProcessor extends TypeAwareProcessor {
"com.google.errorprone.refaster.annotation.OfKind",
"com.google.errorprone.refaster.annotation.Placeholder",
"com.google.errorprone.refaster.annotation.Repeated",
"com.google.errorprone.refaster.annotation.UseImportPolicy",
"com.google.errorprone.annotations.DoNotCall"
"com.google.errorprone.refaster.annotation.UseImportPolicy"
).collect(Collectors.toSet());

static ClassValue<List<String>> LST_TYPE_MAP = new ClassValue<List<String>>() {
Expand Down Expand Up @@ -708,13 +707,12 @@ private TemplateDescriptor validate(Context context, JCCompilationUnit cu) {
}

private boolean validateTemplateMethod(JCTree.JCMethodDecl template) {
// TODO Additional Refaster features https://github.com/openrewrite/rewrite-templating/issues/47
boolean valid = true;
// TODO: support all Refaster method-level annotations
for (JCTree.JCAnnotation annotation : getTemplateAnnotations(template, UNSUPPORTED_ANNOTATIONS::contains)) {
printNoteOnce("@" + annotation.annotationType + " is currently not supported", classDecl.sym);
valid = false;
}
// TODO: support all Refaster parameter-level annotations
for (JCTree.JCVariableDecl parameter : template.getParameters()) {
for (JCTree.JCAnnotation annotation : getTemplateAnnotations(parameter, UNSUPPORTED_ANNOTATIONS::contains)) {
printNoteOnce("@" + annotation.annotationType + " is currently not supported", classDecl.sym);
Expand Down

0 comments on commit c758a24

Please sign in to comment.