From 53c84f4ab3859fa4266b1814496d1c2666bff0ef Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Mon, 15 Feb 2021 12:53:03 +0100 Subject: [PATCH] Change severity and tag --- .../MissingRefasterAnnotationCheck.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationCheck.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationCheck.java index f16481a2da3..ec7abd784fb 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationCheck.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotationCheck.java @@ -29,22 +29,22 @@ name = "MissingRefasterAnnotation", summary = "The Refaster template contains a method without Refaster annotation", linkType = LinkType.NONE, - severity = SeverityLevel.SUGGESTION, - tags = StandardTags.SIMPLIFICATION) + severity = SeverityLevel.WARNING, + tags = StandardTags.LIKELY_ERROR) public final class MissingRefasterAnnotationCheck extends BugChecker implements ClassTreeMatcher { private static final long serialVersionUID = 1L; private static final MultiMatcher HAS_REFASTER_ANNOTATION = annotations( AT_LEAST_ONE, anyOf( + isType("com.google.errorprone.refaster.annotation.Placeholder"), isType("com.google.errorprone.refaster.annotation.BeforeTemplate"), - isType("com.google.errorprone.refaster.annotation.AfterTemplate"), - isType("com.google.errorprone.refaster.annotation.Placeholder"))); + isType("com.google.errorprone.refaster.annotation.AfterTemplate"))); @Override public Description matchClass(ClassTree tree, VisitorState state) { - List normalMethods = new ArrayList<>(); List refasterAnnotatedMethods = new ArrayList<>(); + List otherMethods = new ArrayList<>(); tree.getMembers().stream() .filter(member -> member.getKind() == Tree.Kind.METHOD) @@ -55,11 +55,11 @@ public Description matchClass(ClassTree tree, VisitorState state) { if (HAS_REFASTER_ANNOTATION.matches(member, state)) { refasterAnnotatedMethods.add(member); } else { - normalMethods.add(member); + otherMethods.add(member); } }); - if (refasterAnnotatedMethods.isEmpty() || normalMethods.isEmpty()) { + if (refasterAnnotatedMethods.isEmpty() || otherMethods.isEmpty()) { return Description.NO_MATCH; }