diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsageTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsageTest.java index 1dcb5b734e..410993f614 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsageTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsageTest.java @@ -1,7 +1,6 @@ package tech.picnic.errorprone.bugpatterns; -import static com.google.errorprone.BugCheckerRefactoringTestHelper.newInstance; - +import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.BugCheckerRefactoringTestHelper.FixChoosers; import com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode; import com.google.errorprone.CompilationTestHelper; @@ -67,7 +66,7 @@ void identification() { @Test void replacementFirstSuggestedFix() { - newInstance(FluxFlatMapUsage.class, getClass()) + BugCheckerRefactoringTestHelper.newInstance(FluxFlatMapUsage.class, getClass()) .setFixChooser(FixChoosers.FIRST) .addInputLines( "A.java", @@ -102,7 +101,7 @@ void replacementFirstSuggestedFix() { @Test void replacementSecondSuggestedFix() { - newInstance(FluxFlatMapUsage.class, getClass()) + BugCheckerRefactoringTestHelper.newInstance(FluxFlatMapUsage.class, getClass()) .setFixChooser(FixChoosers.SECOND) .addInputLines( "A.java", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonTest.java index d09a028b6e..e205fb1c19 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonTest.java @@ -12,7 +12,8 @@ // XXX: Can we perhaps work-around this by describing the fixes in reverse order? final class PrimitiveComparisonTest { /** - * @implNote The logic for `char` and `short` is exactly analogous to the `byte` case. + * @implNote The logic for {@code char} and {@code short} is exactly analogous to the {@code byte} + * case. */ @Test void byteComparison() { diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversionTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversionTest.java index 62f82b3f5a..f3d6f018c6 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversionTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversionTest.java @@ -12,13 +12,6 @@ final class RedundantStringConversionTest { private final CompilationTestHelper compilationTestHelper = CompilationTestHelper.newInstance(RedundantStringConversion.class, getClass()); - private final CompilationTestHelper customizedCompilationTestHelper = - CompilationTestHelper.newInstance(RedundantStringConversion.class, getClass()) - .setArgs( - ImmutableList.of( - "-XepOpt:RedundantStringConversion:ExtraConversionMethods=java.lang.Enum#name(),A#name(),A.B#toString(int)")); - private final BugCheckerRefactoringTestHelper refactoringTestHelper = - BugCheckerRefactoringTestHelper.newInstance(RedundantStringConversion.class, getClass()); @Test void identificationOfIdentityTransformation() { @@ -416,7 +409,10 @@ void identificationWithinSlf4jLoggerMethod() { @Test void identificationOfCustomConversionMethod() { - customizedCompilationTestHelper + CompilationTestHelper.newInstance(RedundantStringConversion.class, getClass()) + .setArgs( + ImmutableList.of( + "-XepOpt:RedundantStringConversion:ExtraConversionMethods=java.lang.Enum#name(),A#name(),A.B#toString(int)")) .addSourceLines( "A.java", "import java.math.RoundingMode;", @@ -509,7 +505,7 @@ void identificationOfCustomConversionMethod() { @Test void replacement() { - refactoringTestHelper + BugCheckerRefactoringTestHelper.newInstance(RedundantStringConversion.class, getClass()) .addInputLines( "A.java", "class A {", diff --git a/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/RefasterTest.java b/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/RefasterTest.java index 8ec4e5122c..11db1cd771 100644 --- a/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/RefasterTest.java +++ b/refaster-runner/src/test/java/tech/picnic/errorprone/refaster/runner/RefasterTest.java @@ -50,12 +50,6 @@ final class RefasterTest { "\\[Refaster Rule\\] FooRules\\.ExtraGrouping\\.StringOfSizeThreeRule: " + "A custom description about matching three-char strings\\s+.+\\s+" + "\\(see https://example.com/custom\\)")); - private final BugCheckerRefactoringTestHelper refactoringTestHelper = - BugCheckerRefactoringTestHelper.newInstance(Refaster.class, getClass()); - private final BugCheckerRefactoringTestHelper restrictedRefactoringTestHelper = - BugCheckerRefactoringTestHelper.newInstance(Refaster.class, getClass()) - .setArgs( - "-XepOpt:Refaster:NamePattern=.*\\$(StringOfSizeZeroVerboseRule|StringOfSizeTwoRule)$"); @Test void identification() { @@ -220,7 +214,7 @@ private static SeverityLevel toSeverityLevel(String compilerDiagnosticsPrefix) { @Test void replacement() { - refactoringTestHelper + BugCheckerRefactoringTestHelper.newInstance(Refaster.class, getClass()) .addInputLines( "A.java", "class A {", @@ -246,7 +240,9 @@ void replacement() { @Test void restrictedReplacement() { - restrictedRefactoringTestHelper + BugCheckerRefactoringTestHelper.newInstance(Refaster.class, getClass()) + .setArgs( + "-XepOpt:Refaster:NamePattern=.*\\$(StringOfSizeZeroVerboseRule|StringOfSizeTwoRule)$") .addInputLines( "A.java", "class A {",