From fe8a4c27e8df6b76222b132fc62c6fd90ee91815 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Thu, 10 Nov 2022 21:31:35 +0100 Subject: [PATCH] Simplify and remove obsolete tests --- .../JUnitFactoryMethodDeclaration.java | 122 ++++++------------ .../JUnitFactoryMethodDeclarationTest.java | 120 ----------------- 2 files changed, 43 insertions(+), 199 deletions(-) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitFactoryMethodDeclaration.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitFactoryMethodDeclaration.java index a9f6af7416..294d446ff6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitFactoryMethodDeclaration.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitFactoryMethodDeclaration.java @@ -13,9 +13,6 @@ import static com.google.errorprone.matchers.Matchers.isType; import static com.google.errorprone.matchers.Matchers.not; import static java.util.stream.Collectors.joining; -import static javax.lang.model.element.Modifier.ABSTRACT; -import static javax.lang.model.element.Modifier.FINAL; -import static javax.lang.model.element.Modifier.PRIVATE; import static tech.picnic.errorprone.bugpatterns.util.ConflictDetection.findMethodRenameBlocker; import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL; import static tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers.HAS_METHOD_SOURCE; @@ -35,24 +32,24 @@ import com.google.errorprone.matchers.Matcher; import com.google.errorprone.util.ASTHelpers; import com.sun.source.tree.AnnotationTree; -import com.sun.source.tree.ClassTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.StatementTree; import com.sun.source.tree.Tree.Kind; import com.sun.source.tree.VariableTree; import com.sun.tools.javac.parser.Tokens.Comment; import com.sun.tools.javac.parser.Tokens.TokenKind; -import java.util.Collection; import java.util.List; import java.util.Optional; import java.util.stream.Stream; +import javax.lang.model.element.Modifier; +import javax.lang.model.element.Name; import tech.picnic.errorprone.bugpatterns.util.MoreASTHelpers; import tech.picnic.errorprone.bugpatterns.util.MoreJUnitMatchers; /** * A {@link BugChecker} that flags non-canonical JUnit factory method declarations. * - *

At Picnic, we consider a JUnit factory method canonical if it + *

At Picnic, we consider a JUnit factory method canonical if it: * *