From c758a245fb7ab259ae091f208d6f8952164f37b9 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Sun, 17 Dec 2023 14:40:07 +0100 Subject: [PATCH] Tolerate `@DoNotCall` with no action taken As discussed on #47 --- .../java/template/processor/RefasterTemplateProcessor.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java b/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java index 259acc9f..b4fb3c5b 100644 --- a/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java +++ b/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java @@ -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> LST_TYPE_MAP = new ClassValue>() { @@ -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);