diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/AnnotateFormatMethodTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/AnnotateFormatMethodTest.java index 79d7bfaa6bc..7c712b79208 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/AnnotateFormatMethodTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/AnnotateFormatMethodTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.runner.RunWith; @@ -51,7 +49,6 @@ String formatMe(String formatString, Object... args) { @Test public void formatted() { - assume().that(Runtime.version().feature()).isAtLeast(15); compilationHelper .addSourceLines( "AnnotateFormatMethodPositiveCases.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/AnnotationPositionTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/AnnotationPositionTest.java index a9d6637b752..0a0a983634d 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/AnnotationPositionTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/AnnotationPositionTest.java @@ -16,7 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; import static com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCH; import com.google.errorprone.BugCheckerRefactoringTestHelper; @@ -418,7 +417,6 @@ interface Test { // TODO(b/168625474): 'sealed' doesn't have a TokenKind @Test public void sealedInterface() { - assume().that(Runtime.version().feature()).isAtLeast(15); refactoringHelper .addInputLines( "Test.java", @@ -623,7 +621,6 @@ void m() { @Test public void recordAnnotation() { - assume().that(Runtime.version().feature()).isAtLeast(16); refactoringHelper .addInputLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/CannotMockFinalClassTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/CannotMockFinalClassTest.java index 3bdd0e3bab2..6393f87c9fb 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/CannotMockFinalClassTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/CannotMockFinalClassTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.runner.RunWith; @@ -63,8 +61,6 @@ public void method() { @Test public void positiveCase_record() { - assume().that(Runtime.version().feature()).isAtLeast(16); - compilationHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/ClassCanBeStaticTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/ClassCanBeStaticTest.java index b8182650abc..0782895a0ed 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/ClassCanBeStaticTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/ClassCanBeStaticTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.runner.RunWith; @@ -545,7 +543,6 @@ class Inner {} @Test public void nestedInLocal_static() { - assume().that(Runtime.version().feature()).isAtLeast(16); compilationHelper .addSourceLines( "A.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/DefaultCharsetTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/DefaultCharsetTest.java index e4417896582..741e97eb34b 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/DefaultCharsetTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/DefaultCharsetTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.BugCheckerRefactoringTestHelper.FixChoosers; import com.google.errorprone.CompilationTestHelper; @@ -588,7 +586,6 @@ void f() throws Exception { @Test public void withVar() { - assume().that(Runtime.version().feature()).isAtLeast(15); refactoringTest() .addInputLines( "in/Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/DefaultLocaleTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/DefaultLocaleTest.java index 08f68cdb2b4..00c91a91b21 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/DefaultLocaleTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/DefaultLocaleTest.java @@ -17,7 +17,6 @@ package com.google.errorprone.bugpatterns; import static com.google.common.base.Predicates.containsPattern; -import static com.google.common.truth.TruthJUnit.assume; import static com.google.errorprone.bugpatterns.DefaultLocale.onlyContainsSpecifiersInAllowList; import static java.util.function.Predicate.not; import static org.junit.Assert.assertFalse; @@ -143,7 +142,6 @@ public void formatMethods_negative() { @Test public void stringFormatted() { - assume().that(Runtime.version().feature()).isAtLeast(15); compilationHelper .addSourceLines( "Test.java", @@ -233,7 +231,6 @@ void f(DateTimeFormatterBuilder dtfb) throws Exception { @Test public void factoryMethodsJdk12plus() { - assume().that(Runtime.version().feature()).isAtLeast(12); compilationHelper .addSourceLines( "Test.java", @@ -311,7 +308,6 @@ public void resourceBundle() { @Test public void resourceBundleJdk9plus() { - assume().that(Runtime.version().feature()).isAtLeast(9); compilationHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/FallThroughTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/FallThroughTest.java index ab4e645f498..6efea5a2f1d 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/FallThroughTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/FallThroughTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Ignore; import org.junit.Test; @@ -340,7 +338,6 @@ void f(char c, boolean b) { @Test public void arrowSwitch() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", @@ -366,7 +363,6 @@ void m(Case c) { @Ignore("https://github.com/google/error-prone/issues/2638") @Test public void i2118() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/FieldCanBeStaticTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/FieldCanBeStaticTest.java index 693d5aea27d..94ea9b0e4db 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/FieldCanBeStaticTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/FieldCanBeStaticTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.CompilationTestHelper; import org.junit.Test; @@ -351,7 +349,6 @@ class L { @Test public void inner_static() { - assume().that(Runtime.version().feature()).isAtLeast(16); compilationHelper .addSourceLines( "Test.java", @@ -394,7 +391,6 @@ class L { @Test public void record() { - assume().that(Runtime.version().feature()).isAtLeast(16); compilationHelper .addSourceLines( "ExampleClass.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/MethodCanBeStaticTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/MethodCanBeStaticTest.java index eca5ca0ebb6..e15ebfd8cdd 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/MethodCanBeStaticTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/MethodCanBeStaticTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.common.collect.ImmutableList; import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.CompilationTestHelper; @@ -422,7 +420,6 @@ private int incr(int x) { @Test public void innerClass_static() { - assume().that(Runtime.version().feature()).isAtLeast(16); testHelper .addSourceLines( "Test.java", @@ -491,7 +488,6 @@ private void foo() {} @Test public void positiveLocal() { - assume().that(Runtime.version().feature()).isAtLeast(16); testHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/MisformattedTestDataTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/MisformattedTestDataTest.java index e11c1542aae..27aceca89d9 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/MisformattedTestDataTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/MisformattedTestDataTest.java @@ -16,7 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; import static com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCH; import com.google.errorprone.BugCheckerRefactoringTestHelper; @@ -34,8 +33,6 @@ public final class MisformattedTestDataTest { @Test public void alreadyFormatted_noFinding() { - assume().that(Runtime.version().feature()).isAtLeast(14); - compilationHelper .addSourceLines( "Test.java", @@ -63,8 +60,6 @@ void method() { @Test public void onlyDiffersByFinalNewline_noFinding() { - assume().that(Runtime.version().feature()).isAtLeast(14); - compilationHelper .addSourceLines( "Test.java", @@ -91,8 +86,6 @@ void method() { @Test public void misformatted_suggestsFix() { - assume().that(Runtime.version().feature()).isAtLeast(14); - refactoringHelper .addInputLines( "Test.java", @@ -141,8 +134,6 @@ void method() { @Test public void onlyDiffersByIndentation_notReindented() { - assume().that(Runtime.version().feature()).isAtLeast(14); - refactoringHelper .addInputLines( "Test.java", @@ -171,8 +162,6 @@ void method() { @Test public void escapesSpecialCharacters() { - assume().that(Runtime.version().feature()).isAtLeast(14); - refactoringHelper .addInputLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/MisleadingEscapedSpaceTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/MisleadingEscapedSpaceTest.java index ab2fb40ec07..51e00d75aa6 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/MisleadingEscapedSpaceTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/MisleadingEscapedSpaceTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.runner.RunWith; @@ -30,8 +28,6 @@ public final class MisleadingEscapedSpaceTest { @Test public void misleadingEscape() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", @@ -46,8 +42,6 @@ class Test { @Test public void literalBackslashS() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", @@ -61,8 +55,6 @@ class Test { @Test public void asSingleCharacter_misleading() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", @@ -77,8 +69,6 @@ class Test { @Test public void withinTextBlock_notAtEndOfLine_misleading() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", @@ -100,8 +90,6 @@ class Test { @Test public void atEndOfLine_notMisleading() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", @@ -118,8 +106,6 @@ class Test { @Test public void multipleAtEndOfLine_notMisleading() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", @@ -135,8 +121,6 @@ class Test { @Test public void withinCommentInBrokenUpString_noFinding() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", @@ -150,8 +134,6 @@ class Test { @Test public void atEndOfString_noFinding() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", @@ -168,8 +150,6 @@ class Test { @Test public void escapedSpaceAtEndOfString() { - assume().that(Runtime.version().feature()).isAtLeast(14); - testHelper .addSourceLines( "Test.class", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/MissingDefaultTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/MissingDefaultTest.java index 35d1d18ebef..9152bbf4e9d 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/MissingDefaultTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/MissingDefaultTest.java @@ -257,7 +257,6 @@ boolean f(int i) { @Test public void arrowSwitch() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", @@ -277,7 +276,6 @@ void m(int i) { @Test public void arrowSwitchNegative() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", @@ -297,7 +295,6 @@ void m(int i) { @Test public void arrowComment() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/MissingOverrideTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/MissingOverrideTest.java index 13ad7ae024c..def5bd116d6 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/MissingOverrideTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/MissingOverrideTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.common.collect.ImmutableList; import com.google.errorprone.CompilationTestHelper; import org.junit.Test; @@ -195,8 +193,6 @@ public interface Test extends Super { @Test public void explicitRecordAccessor() { - assume().that(Runtime.version().feature()).isAtLeast(16); - compilationHelper .addSourceLines( "Baz.java", @@ -219,8 +215,6 @@ public int y() { @Test public void explicitRecordAccessor_doesNotFlagConstructors() { - assume().that(Runtime.version().feature()).isAtLeast(16); - compilationHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/MixedMutabilityReturnTypeTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/MixedMutabilityReturnTypeTest.java index 4e4ba6eef98..0f95c72c8ca 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/MixedMutabilityReturnTypeTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/MixedMutabilityReturnTypeTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.BugCheckerRefactoringTestHelper.FixChoosers; import com.google.errorprone.CompilationTestHelper; @@ -555,7 +553,6 @@ List foo(T a) { @Test public void refactoringWithVar() { - assume().that(Runtime.version().feature()).isAtLeast(15); refactoringHelper .addInputLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/NamedLikeContextualKeywordTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/NamedLikeContextualKeywordTest.java index d7dc67e66bc..c72548a59a6 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/NamedLikeContextualKeywordTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/NamedLikeContextualKeywordTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.common.collect.ImmutableList; import com.google.errorprone.CompilationTestHelper; import org.junit.Test; @@ -153,8 +151,6 @@ public module() {} @Test public void yieldInSwitch_noError() { - - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/NullTernaryTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/NullTernaryTest.java index d6cbf215c02..0bcabef72a7 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/NullTernaryTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/NullTernaryTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.runner.RunWith; @@ -134,7 +132,6 @@ void conditionalInCondition(Object array, String input) { @Test public void expressionSwitch_doesNotCrash() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/PrivateConstructorForUtilityClassTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/PrivateConstructorForUtilityClassTest.java index 534def20b43..4072e1cb301 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/PrivateConstructorForUtilityClassTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/PrivateConstructorForUtilityClassTest.java @@ -15,8 +15,6 @@ */ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.CompilationTestHelper; import org.junit.Test; @@ -414,7 +412,6 @@ abstract class Test { @Test public void record() { - assume().that(Runtime.version().feature()).isAtLeast(16); CompilationTestHelper.newInstance(PrivateConstructorForUtilityClass.class, getClass()) .addSourceLines( "ExampleUtilityClass.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitchTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitchTest.java index 7cac131bb20..60a6a12efa9 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitchTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitchTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.common.collect.ImmutableList; import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.CompilationTestHelper; @@ -36,8 +34,6 @@ public final class StatementSwitchToExpressionSwitchTest { @Test public void switchByEnum_removesRedundantBreak_error() { - - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -137,8 +133,6 @@ public void foo(Side side) { @Test public void switchByEnumWithCompletionAnalsis_removesRedundantBreak_error() { - - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -232,8 +226,6 @@ public void foo(Side side) { @Test public void switchByEnumCard_combinesCaseComments_error() { - - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -340,8 +332,6 @@ public void foo(Side side) { @Test public void switchByEnumCard2_removesRedundantBreaks_error() { - - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -445,8 +435,6 @@ public void foo(Side side) { @Test public void switchByEnumCard_onlyExpressionsAndThrowAreBraceless_error() { - - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -551,8 +539,6 @@ public void foo(Side side) { @Test public void switchFallsThruToDefault_noError() { - - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -590,7 +576,6 @@ public void foo(Side side) { public void switchFallsThruFromDefault_noError() { // Placing default in the middle of the switch is not recommended, but is valid Java - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -628,9 +613,7 @@ public void foo(Side side) { @Test public void switchWithDefaultInMiddle_error() { - // Placing default in the middle of the switch is not recommended, but is valid Java - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -735,7 +718,6 @@ public void foo(Side side) { @Test public void switchWithLabelledBreak_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -841,7 +823,6 @@ public void foo(Side side) { @Test public void switchByEnum_statementSwitchWithMultipleExpressions_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -933,7 +914,6 @@ public void foo(Side side) { @Test public void switchByEnumCardWithThrow_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -971,7 +951,6 @@ public void foo(Side side) { @Test public void switchInSwitch_error() { // Only the outer "switch" should generate a finding - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1015,7 +994,6 @@ public void foo(Side side) { @Test public void switchByEnumCardWithReturnNested1_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1113,7 +1091,6 @@ public void foo(Side side) { @Test public void switchByEnumCardWithReturnNested2_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1156,7 +1133,6 @@ public void foo(Side side) { @Test public void switchByEnumWithConditionalControl_noError() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1194,7 +1170,6 @@ public void foo(Side side) { @Test public void switchByEnumWithLambda_noError() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1226,7 +1201,6 @@ public void switchByEnumWithLambda_noError() { @Test public void singleCaseConvertible_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1258,7 +1232,6 @@ public void foo(Side side) { @Test public void emptyExpressionSwitchCases_noMatch() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1277,7 +1250,6 @@ void foo(int value) { @Test public void nonEmptyExpressionSwitchCases_noMatch() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1298,7 +1270,6 @@ void foo(int value) { @Test public void dynamicWithThrowableDuringInitializationFromMethod_noMatch() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1321,7 +1292,6 @@ private static Throwable bar() { @Test public void switchByEnum_exampleInDocumentation_error() { // This code appears as an example in the documentation (added surrounding class) - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1427,7 +1397,6 @@ private void bar() {} public void switchByEnum_caseHasOnlyComments_error() { // When a case is solely comments, we should still try to convert the switch using braceless // syntax - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1537,7 +1506,6 @@ private void bar() {} @Test public void switchByEnum_accumulatedComments_error() { // Comments should be aggregated across multiple cases - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1649,7 +1617,6 @@ private void bar() {} public void switchByEnum_surroundingBracesCannotRemove_error() { // Can't remove braces around OBVERSE because break statements are not a member of // KINDS_CONVERTIBLE_WITHOUT_BRACES - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1741,7 +1708,6 @@ public void foo(Side side) { public void switchByEnum_surroundingBracesEmpty_error() { // Test handling of cases with surrounding braces that are empty. The braces around OBVERSE // can be removed because throw is a member of KINDS_CONVERTIBLE_WITHOUT_BRACES. - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( @@ -1830,7 +1796,6 @@ public void foo(Side side) { @Test public void switchByEnum_afterReturnComments_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -1934,7 +1899,6 @@ public int foo(Suit suit) { @Test public void switchByEnum_returnSwitch_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -2038,7 +2002,6 @@ public int foo(Side side) { @Test public void switchByEnum_returnSwitchWithShouldNeverHappen_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); // Check correct generated code refactoringHelper @@ -2112,7 +2075,6 @@ public int foo(Side side) { @Test public void switchByEnum_returnSwitchCommentsBeforeFirstCase_errorAndRetained() { - assume().that(Runtime.version().feature()).isAtLeast(14); // Check correct generated code refactoringHelper @@ -2192,7 +2154,6 @@ public int foo(Side side) { @Test public void switchByEnum_switchInReturnSwitchWithShouldNeverHappen_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); // No error because the inner switch is the only fixable one helper .addSourceLines( @@ -2245,7 +2206,6 @@ public int foo(Side side) { @Test public void switchByEnum_exhaustiveWithDefault_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -2353,7 +2313,6 @@ public int foo(Side side) { @Test public void switchByEnum_defaultFallThru_noError() { // No error because default doesn't return anything within its block - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -2395,7 +2354,6 @@ public int foo(Side side) { @Test public void switchByEnum_alwaysThrows_noError() { // Every case throws, thus no type for return switch - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -2436,7 +2394,6 @@ public int foo(Side side) { @Test public void switchByEnum_returnSwitchWithShouldNeverHappen_errorAndRemoveShouldNeverHappen() { // The switch has a case for each enum and "should never happen" error handling - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -2585,7 +2542,6 @@ public int foo(Side side) { public void switchByEnum_returnSwitchNoFollowingStatementsInBlock_errorAndNoRemoval() { // The switch is exhaustive but doesn't have any statements immediately following it in the // lowest ancestor statement block - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -2728,7 +2684,6 @@ public int foo(Side side) { public void switchByEnum_groupedComments_errorAndNoRemoval() { // The switch is exhaustive but doesn't have any statements immediately following it in the // lowest ancestor statement block - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -2887,7 +2842,6 @@ public int foo(Side side) { public void switchByEnum_returnSwitchWithShouldNeverHappenInLambda_errorAndRemoveShouldNeverHappen() { // Conversion to return switch within a lambda - assume().that(Runtime.version().feature()).isAtLeast(14); refactoringHelper .addInputLines( @@ -2978,7 +2932,6 @@ public int foo(Side side) { @Test public void switchByEnum_returnSwitchVoid_noError() { // A void cannot be converted to a return switch - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3016,7 +2969,6 @@ public void foo(Side side) { @Test public void switchByEnum_returnLabelledContinue_noError() { // Control jumps outside the switch for HEART - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3057,7 +3009,6 @@ public int foo(Side side) { @Test public void switchByEnum_returnUnlabelledContinue_noError() { // Control jumps outside the switch for HEART - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3098,7 +3049,6 @@ public int foo(Side side) { @Test public void switchByEnum_returnLabelledBreak_noError() { // Control jumps outside the switch for HEART - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3140,7 +3090,6 @@ public int foo(Side side) { @Test public void switchByEnum_returnYield_noError() { // Does not attempt to convert "yield" expressions - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3183,7 +3132,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentSwitchToLocalHasDefault_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3285,7 +3233,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentSwitchMixedReferences_error() { // Must deduce that "x" and "this.x" refer to same thing - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3410,7 +3357,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentSwitchMixedReferences_noError() { // Must deduce that "x" and "this.y" refer to different things - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3456,7 +3402,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentSwitchTwoAssignments_noError() { // Can't convert multiple assignments, even if redundant - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3501,7 +3446,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentSwitchToSingleArray_error() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3618,7 +3562,6 @@ public void switchByEnum_assignmentSwitchToMultipleArray_noError() { // Multiple array dereferences or other non-variable left-hand-side expressions may (in // principle) be convertible to assignment switches, but this feature is not supported at this // time - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3664,7 +3607,6 @@ public int[] foo(Side side) { @Test public void switchByEnum_assignmentSwitchToMultipleDistinct_noError() { // x[5] and x[6] are distinct assignment targets - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3711,7 +3653,6 @@ public int[] foo(Side side) { public void switchByEnum_assignmentSwitchMixedKinds_noError() { // Different assignment types ("=" versus "+="). The check does not attempt to alter the // assignments to make the assignment types match (e.g. does not change to "x = x + 2") - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3755,7 +3696,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentLabelledContinue_noError() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3805,7 +3745,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentLabelledBreak_noError() { // Can't convert because of "break before" - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3855,7 +3794,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentLabelledBreak2_noError() { // Can't convert because of "break before" as the second statement in its block - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3905,7 +3843,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentUnlabelledContinue_noError() { - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3955,7 +3892,6 @@ public int foo(Side side) { @Test public void switchByEnum_assignmentYield_noError() { // Does not attempt to convert "yield" expressions - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -3998,7 +3934,6 @@ public void switchByEnum_exhaustiveAssignmentSwitch_error() { // Transformation can change error handling. Here, if the enum is not exhaustive at runtime // (say there is a new JOKER suit), then nothing would happen. But the transformed source, // would throw. - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -4105,7 +4040,6 @@ public int foo(Side side) { @Test public void switchByEnum_exhaustiveCompoundAssignmentSwitch_error() { // Verify compound assignments (here, +=) - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -4206,7 +4140,6 @@ public int foo(Side side) { @Test public void switchByEnum_groupedComments_error() { // Verify compound assignments (here, *=) with grouped comments - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -4333,7 +4266,6 @@ public int foo(Side side) { @Test public void switchByEnum_compoundAssignmentExampleInDocumentation_error() { // This code appears as an example in the documentation (added surrounding class) - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -4435,7 +4367,6 @@ private void updateScore(Suit suit) { @Test public void switchByEnum_exhaustiveAssignmentSwitchCaseList_error() { // Statement switch has cases with multiple values - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -4529,7 +4460,6 @@ public int foo(Side side) { @Test public void switchByEnum_nonExhaustiveAssignmentSwitch_noError() { // No HEART case - assume().that(Runtime.version().feature()).isAtLeast(14); helper .addSourceLines( "Test.java", @@ -4567,7 +4497,6 @@ public int foo(Side side) { @Test public void i4222() { - assume().that(Runtime.version().feature()).isAtLeast(14); refactoringHelper .addInputLines( "Test.java", @@ -4613,7 +4542,6 @@ public static void main(String[] args) { @Test public void unnecessaryBreaks() { - assume().that(Runtime.version().feature()).isAtLeast(14); refactoringHelper .addInputLines( "Test.java", @@ -4653,7 +4581,6 @@ public static void main(String[] args) { @Test public void mixedExpressionsAndYields() { - assume().that(Runtime.version().feature()).isAtLeast(14); refactoringHelper .addInputLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/StreamResourceLeakTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/StreamResourceLeakTest.java index 2dc099bf071..26b24ee28f9 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/StreamResourceLeakTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/StreamResourceLeakTest.java @@ -16,7 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; import static java.lang.String.format; import com.google.errorprone.BugCheckerRefactoringTestHelper; @@ -322,7 +321,6 @@ default DirectoryStream f(Path path) throws IOException { @Test public void record() { - assume().that(Runtime.version().feature()).isAtLeast(16); testHelper .addSourceLines( "ExampleRecord.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/StringFormatWithLiteralTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/StringFormatWithLiteralTest.java index d68f69715d2..031321f3d23 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/StringFormatWithLiteralTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/StringFormatWithLiteralTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.CompilationTestHelper; import org.junit.Test; @@ -229,7 +227,6 @@ String test() { @Test public void refactoringFormattedWithNoArguments() { - assume().that(Runtime.version().feature()).isAtLeast(15); refactoringHelper .addInputLines( "ExampleClass.java", @@ -278,7 +275,6 @@ String test() { @Test public void refactoringFormattedWithIntegerLiteral() { - assume().that(Runtime.version().feature()).isAtLeast(15); refactoringHelper .addInputLines( "ExampleClass.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/SwitchDefaultTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/SwitchDefaultTest.java index 8ab96914511..56a035f211c 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/SwitchDefaultTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/SwitchDefaultTest.java @@ -258,7 +258,6 @@ boolean f(int i) { @Test public void newNotation_validDefault() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", @@ -284,7 +283,6 @@ public static void switchDefaultCrash(int i) { @Test public void newNotation_changeOrder() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addInputLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/TraditionalSwitchExpressionTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/TraditionalSwitchExpressionTest.java index e881c1a40b3..3beb7917861 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/TraditionalSwitchExpressionTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/TraditionalSwitchExpressionTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.runner.RunWith; @@ -31,7 +29,6 @@ public class TraditionalSwitchExpressionTest { @Test public void positive() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", @@ -69,7 +66,6 @@ void f(int i) { @Test public void negativeArrowStatement() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", @@ -87,7 +83,6 @@ void f(int i) { @Test public void negativeArrow() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/UngroupedOverloadsTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/UngroupedOverloadsTest.java index 862c467df6c..5b1d1a3a377 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/UngroupedOverloadsTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/UngroupedOverloadsTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.common.collect.ImmutableList; import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode; @@ -851,8 +849,6 @@ private void bar() {} @Test public void recordConstructor() { - assume().that(Runtime.version().feature()).isAtLeast(16); - compilationHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryBreakInSwitchTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryBreakInSwitchTest.java index 6417e9dfd96..fe01261403b 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryBreakInSwitchTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryBreakInSwitchTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.runner.RunWith; @@ -31,7 +29,6 @@ public class UnnecessaryBreakInSwitchTest { @Test public void positive() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", @@ -72,7 +69,6 @@ void f(int i) { @Test public void negativeEmpty() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", @@ -91,7 +87,6 @@ void f(int i) { @Test public void negativeNotLast() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", @@ -115,7 +110,6 @@ void f(int i) { @Test public void negativeLabelledBreak() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", @@ -138,7 +132,6 @@ void f(int i) { @Test public void negativeLoop() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", @@ -162,7 +155,6 @@ void f(int i) { @Test public void positiveIf() { - assume().that(Runtime.version().feature()).isAtLeast(14); testHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryDefaultInEnumSwitchTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryDefaultInEnumSwitchTest.java index de7cd82e551..6b55cc8444e 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryDefaultInEnumSwitchTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryDefaultInEnumSwitchTest.java @@ -16,7 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; import static com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCH; import com.google.errorprone.BugCheckerRefactoringTestHelper; @@ -1059,7 +1058,6 @@ void proto(ProtoEnum e) { @Test public void defaultCaseKindRule() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", @@ -1085,7 +1083,6 @@ void m(Case c) { @Test public void unrecognizedCaseKindRule() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", @@ -1112,7 +1109,6 @@ void m(Case c) { @Test public void multipleLabels() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryParenthesesTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryParenthesesTest.java index 0cf2d5b554f..00732c159c6 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryParenthesesTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/UnnecessaryParenthesesTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.CompilationTestHelper; import org.junit.Test; @@ -280,7 +278,6 @@ int f(boolean b, Integer x) { @Test public void switchExpression() { - assume().that(Runtime.version().feature()).isAtLeast(12); helper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/UnusedVariableTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/UnusedVariableTest.java index 8c8f369136e..b12e037b5ab 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/UnusedVariableTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/UnusedVariableTest.java @@ -1570,7 +1570,6 @@ public void f(List> lists) { @Test public void simpleRecord() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "SimpleRecord.java", // @@ -1581,7 +1580,6 @@ public void simpleRecord() { @Test public void nestedRecord() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "SimpleClass.java", @@ -1596,7 +1594,6 @@ public record SimpleRecord (Integer foo, Long bar) {} @Test public void recordWithStaticFields() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "SimpleClass.java", @@ -1627,7 +1624,6 @@ public int b() { // methods differently @Test public void nestedPrivateRecord() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "SimpleClass.java", @@ -1642,7 +1638,6 @@ private record SimpleRecord (Integer foo, Long bar) {} @Test public void nestedPrivateRecordCompactCanonicalConstructor() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "SimpleClass.java", @@ -1660,7 +1655,6 @@ public void nestedPrivateRecordCompactCanonicalConstructor() { @Test public void nestedPrivateRecordNormalCanonicalConstructor() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "SimpleClass.java", @@ -1680,7 +1674,6 @@ private SimpleRecord(Integer foo, Long bar) { @Test public void unusedRecordConstructorParameter() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "SimpleRecord.java", @@ -1697,7 +1690,6 @@ private SimpleRecord(int a, int b) { @Test public void unusedInRecord() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "SimpleClass.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/argumentselectiondefects/ArgumentSelectionDefectCheckerTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/argumentselectiondefects/ArgumentSelectionDefectCheckerTest.java index 5fcc032d1b7..e1115ac5ccd 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/argumentselectiondefects/ArgumentSelectionDefectCheckerTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/argumentselectiondefects/ArgumentSelectionDefectCheckerTest.java @@ -15,8 +15,6 @@ */ package com.google.errorprone.bugpatterns.argumentselectiondefects; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.common.collect.ImmutableSet; import com.google.errorprone.BugPattern; import com.google.errorprone.BugPattern.SeverityLevel; @@ -386,8 +384,6 @@ void test(Object first, Object second) { @Test public void records() { - assume().that(Runtime.version().feature()).isAtLeast(16); - testHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/formatstring/FormatStringTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/formatstring/FormatStringTest.java index cd574e18c7b..f201e0602f1 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/formatstring/FormatStringTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/formatstring/FormatStringTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns.formatstring; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.runner.RunWith; @@ -368,7 +366,6 @@ void f(Number n) { @Test public void invalidIndex() { - assume().that(Runtime.version().feature()).isAtLeast(16); compilationHelper .addSourceLines( "T.java", @@ -385,7 +382,6 @@ public static void main(String[] args) { @Test public void stringFormattedNegativeCase() { - assume().that(Runtime.version().feature()).isAtLeast(15); compilationHelper .addSourceLines( "Test.java", @@ -401,7 +397,6 @@ void f() { @Test public void stringFormattedPositiveCase() { - assume().that(Runtime.version().feature()).isAtLeast(15); compilationHelper .addSourceLines( "Test.java", @@ -418,7 +413,6 @@ void f() { @Test public void nonConstantStringFormattedNegativeCase() { - assume().that(Runtime.version().feature()).isAtLeast(15); compilationHelper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/javadoc/InvalidParamTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/javadoc/InvalidParamTest.java index fa496abbf17..6c4318d69e3 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/javadoc/InvalidParamTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/javadoc/InvalidParamTest.java @@ -16,7 +16,6 @@ package com.google.errorprone.bugpatterns.javadoc; -import static com.google.common.truth.TruthJUnit.assume; import static com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCH; import com.google.errorprone.BugCheckerRefactoringTestHelper; @@ -215,7 +214,6 @@ interface Test { @Test public void negative_record() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "Test.java", @@ -230,7 +228,6 @@ public record Test(String name) {} @Test public void badParameterName_record() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "Test.java", @@ -246,7 +243,6 @@ public record Test(String foo) {} @Test public void multipleConstructors_record() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "Test.java", @@ -274,7 +270,6 @@ public Test(String foo) { @Test public void typeParameter_record() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "Negative.java", @@ -302,7 +297,6 @@ public record Positive(T contents, String bar) {} @Test public void compactConstructor_record() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "Test.java", @@ -319,7 +313,6 @@ public record Test(String name) { @Test public void normalConstructor_record() { - assume().that(Runtime.version().feature()).isAtLeast(16); helper .addSourceLines( "Test.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/nullness/FieldMissingNullableTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/nullness/FieldMissingNullableTest.java index 8d3caefe03e..c6c4e1b5063 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/nullness/FieldMissingNullableTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/nullness/FieldMissingNullableTest.java @@ -16,7 +16,6 @@ package com.google.errorprone.bugpatterns.nullness; -import static com.google.common.truth.TruthJUnit.assume; import static com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCH; import com.google.errorprone.BugCheckerRefactoringTestHelper; @@ -193,7 +192,6 @@ public void reset(FieldMissingNullTest other) { @Test public void recordComponent() { - assume().that(Runtime.version().feature()).isAtLeast(16); createAggressiveRefactoringTestHelper() .addInputLines( "com/google/errorprone/bugpatterns/nullness/FieldMissingNullTest.java", @@ -340,7 +338,6 @@ public void reset() { @Test public void negativeCases_alreadyAnnotatedRecordComponent() { - assume().that(Runtime.version().feature()).isAtLeast(16); createAggressiveCompilationTestHelper() .addSourceLines( "com/google/errorprone/bugpatterns/nullness/FieldMissingNullTest.java", diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/nullness/ReturnMissingNullableTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/nullness/ReturnMissingNullableTest.java index f0390d5d47d..3f85ea431d9 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/nullness/ReturnMissingNullableTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/nullness/ReturnMissingNullableTest.java @@ -16,7 +16,6 @@ package com.google.errorprone.bugpatterns.nullness; -import static com.google.common.truth.TruthJUnit.assume; import static com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCH; import com.google.errorprone.BugCheckerRefactoringTestHelper; @@ -150,7 +149,6 @@ public String getMessage(int x) { @Test public void switchExpressionTree() { - assume().that(Runtime.version().feature()).isAtLeast(12); createCompilationTestHelper() .addSourceLines( @@ -172,7 +170,6 @@ public String getMessage(int x) { @Test public void switchExpressionTree_negative() { - assume().that(Runtime.version().feature()).isAtLeast(12); createCompilationTestHelper() .addSourceLines( diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/ImmutableCheckerTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/ImmutableCheckerTest.java index 7150dd00611..9b86c3a6500 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/ImmutableCheckerTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/ImmutableCheckerTest.java @@ -16,8 +16,6 @@ package com.google.errorprone.bugpatterns.threadsafety; -import static com.google.common.truth.TruthJUnit.assume; - import com.google.common.collect.ImmutableList; import com.google.errorprone.CompilationTestHelper; import com.google.errorprone.annotations.CanIgnoreReturnValue; @@ -3453,7 +3451,6 @@ void test(ImmutableFunction f) { @Test public void switchExpressionsResultingInGenericTypes_doesNotThrow() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Kind.java", @@ -3480,7 +3477,6 @@ Supplier> test(Kind kind) { @Test public void switchExpressionsYieldStatement_doesNotThrow() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", @@ -3502,7 +3498,6 @@ String test(String mode) { @Test public void switchExpressionsMethodReference_doesNotThrow() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java", @@ -3522,7 +3517,6 @@ Supplier test(String mode) { @Test public void switchExpressionsYieldStatementMethodReference_doesNotThrow() { - assume().that(Runtime.version().feature()).isAtLeast(14); compilationHelper .addSourceLines( "Test.java",