diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/JUnit4TestNotRun.java b/core/src/main/java/com/google/errorprone/bugpatterns/JUnit4TestNotRun.java index 8cd191eb630..0a26e9d4996 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/JUnit4TestNotRun.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/JUnit4TestNotRun.java @@ -35,7 +35,6 @@ import com.google.common.collect.ImmutableSet; import com.google.errorprone.BugPattern; -import com.google.errorprone.ErrorProneFlags; import com.google.errorprone.VisitorState; import com.google.errorprone.bugpatterns.BugChecker.ClassTreeMatcher; import com.google.errorprone.fixes.SuggestedFix; @@ -57,7 +56,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import javax.inject.Inject; import javax.lang.model.element.Modifier; /** @@ -97,14 +95,6 @@ private static boolean isParameterAnnotation(AnnotationTree annotation, VisitorS private static final Matcher NOT_STATIC = not(hasModifier(STATIC)); - private final boolean underscoreHeuristic; - - @Inject - JUnit4TestNotRun(ErrorProneFlags flags) { - this.underscoreHeuristic = - flags.getBoolean("JUnit4TestNotRun:UnderscoreHeuristic").orElse(true); - } - @Override public Description matchClass(ClassTree tree, VisitorState state) { if (!isJUnit4TestClass.matches(tree, state)) { @@ -170,7 +160,7 @@ private Optional handleMethod(MethodTree methodTree, VisitorState s } // Method name contains underscores: it's either a test or a style violation. - if (underscoreHeuristic && methodTree.getName().toString().contains("_")) { + if (methodTree.getName().toString().contains("_")) { return Optional.of(describeFixes(methodTree, state)); }