diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/JUnit4ClassUsedInJUnit3.java b/core/src/main/java/com/google/errorprone/bugpatterns/JUnit4ClassUsedInJUnit3.java index 7be3a59889f..c6f2eef4d43 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/JUnit4ClassUsedInJUnit3.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/JUnit4ClassUsedInJUnit3.java @@ -66,10 +66,7 @@ public Description matchAnnotation(AnnotationTree tree, VisitorState state) { if (!enclosingClass(isJUnit3TestClass).matches(tree, state)) { return NO_MATCH; } - // If we are inside a JUnit3 test class some annotation should not appear. - if (isType("org.junit.Ignore").matches(tree, state)) { - return makeDescription("@Ignore", tree); - } + // If we are inside a JUnit3 test class some annotations should not appear. if (isType("org.junit.Rule").matches(tree, state)) { return makeDescription("@Rule", tree); } diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/JUnit4ClassUsedInJUnit3Test.java b/core/src/test/java/com/google/errorprone/bugpatterns/JUnit4ClassUsedInJUnit3Test.java index 21aa2fdb302..fbdca15484b 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/JUnit4ClassUsedInJUnit3Test.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/JUnit4ClassUsedInJUnit3Test.java @@ -197,46 +197,6 @@ public void testName3() {} .doTest(); } - @Test - public void positive_ignore_on_test() { - compilationHelper - .addSourceLines( - "Foo.java", - """ - import junit.framework.TestCase; - import org.junit.Ignore; - - public class Foo extends TestCase { - public void testName1() {} - - // BUG: Diagnostic contains: @Ignore - @Ignore - public void testName2() {} - } - """) - .doTest(); - } - - @Test - public void positive_ignore_on_class() { - compilationHelper - .addSourceLines( - "Foo.java", - """ - import junit.framework.TestCase; - import org.junit.Ignore; - - // BUG: Diagnostic contains: @Ignore - @Ignore - public class Foo extends TestCase { - public void testName1() {} - - public void testName2() {} - } - """) - .doTest(); - } - @Test public void positive_rule_in_junit3() { compilationHelper