From 15a3f9c3d28d602305fff4c9c9f3ac4a8ce177f4 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Tue, 20 Sep 2022 09:40:22 +0200 Subject: [PATCH 1/3] Drop obsolete package prefix in BugChecker tests --- .../bugpatterns/AmbiguousJsonCreatorTest.java | 4 ++-- .../bugpatterns/AutowiredConstructorTest.java | 4 ++-- .../bugpatterns/EmptyMethodTest.java | 4 ++-- .../ErrorProneTestHelperSourceFormatTest.java | 12 +++++----- .../bugpatterns/FluxFlatMapUsageTest.java | 8 +++---- .../FormatStringConcatenationTest.java | 4 ++-- .../JUnitMethodDeclarationTest.java | 4 ++-- ...aphicalAnnotationAttributeListingTest.java | 4 ++-- .../LexicographicalAnnotationListingTest.java | 4 ++-- .../bugpatterns/MethodReferenceUsageTest.java | 4 ++-- .../bugpatterns/MockitoStubbingTest.java | 4 ++-- .../bugpatterns/PrimitiveComparisonTest.java | 24 +++++++++---------- .../RedundantStringConversionTest.java | 4 ++-- .../bugpatterns/RefasterAnyOfUsageTest.java | 4 ++-- .../ScheduledTransactionTraceTest.java | 4 ++-- .../bugpatterns/Slf4JLogStatementTest.java | 4 ++-- .../bugpatterns/SpringMvcAnnotationTest.java | 4 ++-- .../bugpatterns/StaticImportTest.java | 4 ++-- 18 files changed, 52 insertions(+), 52 deletions(-) diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreatorTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreatorTest.java index a59bb2e7f0..f5a7b641ad 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreatorTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreatorTest.java @@ -120,7 +120,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import com.fasterxml.jackson.annotation.JsonCreator;", "", "enum A {", @@ -132,7 +132,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import com.fasterxml.jackson.annotation.JsonCreator;", "", "enum A {", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructorTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructorTest.java index 0e5916892b..459e765b72 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructorTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructorTest.java @@ -73,7 +73,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/Container.java", + "Container.java", "import org.springframework.beans.factory.annotation.Autowired;", "", "interface Container {", @@ -89,7 +89,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/Container.java", + "Container.java", "import org.springframework.beans.factory.annotation.Autowired;", "", "interface Container {", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/EmptyMethodTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/EmptyMethodTest.java index 51ad68f917..e1fdbc360e 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/EmptyMethodTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/EmptyMethodTest.java @@ -71,13 +71,13 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "final class A {", " void instanceMethod() {}", "", " static void staticMethod() {}", "}") - .addOutputLines("out/A.java", "final class A {}") + .addOutputLines("A.java", "final class A {}") .doTest(TestMode.TEXT_MATCH); } } diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormatTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormatTest.java index 89d57f9297..1ba7a758d1 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormatTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormatTest.java @@ -65,7 +65,7 @@ void replacement() { */ refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import com.google.errorprone.BugCheckerRefactoringTestHelper;", "import com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode;", "import com.google.errorprone.CompilationTestHelper;", @@ -90,14 +90,14 @@ void replacement() { "", " refactoringTestHelper", " .addInputLines(", - " \"in/A.java\",", + " \"A.java\",", " \"import java.util.Map;\",", " \"import java.util.Collection;\",", " \"import java.util.List;\",", " \"\",", " \"interface A extends List, Map { }\")", " .addOutputLines(", - " \"out/A.java\",", + " \"A.java\",", " \"import java.util.Map;\",", " \"import java.util.Collection;\",", " \"import java.util.List;\",", @@ -107,7 +107,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import com.google.errorprone.BugCheckerRefactoringTestHelper;", "import com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode;", "import com.google.errorprone.CompilationTestHelper;", @@ -131,13 +131,13 @@ void replacement() { "", " refactoringTestHelper", " .addInputLines(", - " \"in/A.java\",", + " \"A.java\",", " \"import java.util.List;\",", " \"import java.util.Map;\",", " \"\",", " \"interface A extends List, Map {}\")", " .addOutputLines(", - " \"out/A.java\",", + " \"A.java\",", " \"import java.util.Collection;\",", " \"import java.util.List;\",", " \"import java.util.Map;\",", 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 a120fb0263..7cfd295b56 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 @@ -67,7 +67,7 @@ void replacementFirstSuggestedFix() { refactoringTestHelper .setFixChooser(FixChoosers.FIRST) .addInputLines( - "in/A.java", + "A.java", "import reactor.core.publisher.Flux;", "", "class A {", @@ -77,7 +77,7 @@ void replacementFirstSuggestedFix() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import reactor.core.publisher.Flux;", "", "class A {", @@ -94,7 +94,7 @@ void replacementSecondSuggestedFix() { refactoringTestHelper .setFixChooser(FixChoosers.SECOND) .addInputLines( - "in/A.java", + "A.java", "import reactor.core.publisher.Flux;", "", "class A {", @@ -106,7 +106,7 @@ void replacementSecondSuggestedFix() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import reactor.core.publisher.Flux;", "", "class A {", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenationTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenationTest.java index 737f00cc99..3eac62e01c 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenationTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenationTest.java @@ -311,7 +311,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static com.google.common.base.Preconditions.checkArgument;", "import static org.assertj.core.api.Assertions.assertThat;", "", @@ -360,7 +360,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import static com.google.common.base.Preconditions.checkArgument;", "import static org.assertj.core.api.Assertions.assertThat;", "", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclarationTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclarationTest.java index e0f7e63492..2320daf7c9 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclarationTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclarationTest.java @@ -308,7 +308,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static org.junit.jupiter.params.provider.Arguments.arguments;", "", "import org.junit.jupiter.api.AfterAll;", @@ -363,7 +363,7 @@ void replacement() { " private void testClass() {}", "}") .addOutputLines( - "out/A.java", + "A.java", "import static org.junit.jupiter.params.provider.Arguments.arguments;", "", "import org.junit.jupiter.api.AfterAll;", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingTest.java index 975eef0375..e7740423c7 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingTest.java @@ -167,7 +167,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static java.math.RoundingMode.DOWN;", "import static java.math.RoundingMode.UP;", "", @@ -204,7 +204,7 @@ void replacement() { " A unsortedInnderAnns();", "}") .addOutputLines( - "out/A.java", + "A.java", "import static java.math.RoundingMode.DOWN;", "import static java.math.RoundingMode.UP;", "", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListingTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListingTest.java index 3af843564e..8f45b3940a 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListingTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListingTest.java @@ -114,7 +114,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import java.lang.annotation.Repeatable;", "", "interface A {", @@ -176,7 +176,7 @@ void replacement() { " A unsortedRepeatableAnnotation();", "}") .addOutputLines( - "out/A.java", + "A.java", "import java.lang.annotation.Repeatable;", "", "interface A {", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java index dce5a4db13..1ae63913ee 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java @@ -325,7 +325,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static java.util.Collections.emptyList;", "", "import java.util.Collections;", @@ -378,7 +378,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import static java.util.Collections.emptyList;", "", "import java.util.Collections;", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MockitoStubbingTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MockitoStubbingTest.java index 50bb041454..a1725d4b02 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MockitoStubbingTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MockitoStubbingTest.java @@ -57,7 +57,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static org.mockito.ArgumentMatchers.eq;", "import static org.mockito.Mockito.doAnswer;", "import static org.mockito.Mockito.mock;", @@ -80,7 +80,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import static org.mockito.ArgumentMatchers.eq;", "import static org.mockito.Mockito.doAnswer;", "import static org.mockito.Mockito.mock;", 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 cace3d7a2e..276fb3633d 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 @@ -499,7 +499,7 @@ void stringComparison() { void replacementWithPrimitiveVariants() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import java.util.Comparator;", "", "interface A extends Comparable {", @@ -536,7 +536,7 @@ void replacementWithPrimitiveVariants() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import java.util.Comparator;", "", "interface A extends Comparable {", @@ -579,7 +579,7 @@ void replacementWithPrimitiveVariants() { void replacementWithBoxedVariants() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import java.util.Comparator;", "", "interface A extends Comparable {", @@ -609,7 +609,7 @@ void replacementWithBoxedVariants() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import java.util.Comparator;", "", "interface A extends Comparable {", @@ -645,7 +645,7 @@ void replacementWithBoxedVariants() { void replacementWithPrimitiveVariantsUsingStaticImports() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static java.util.Comparator.comparing;", "", "import java.util.Comparator;", @@ -660,7 +660,7 @@ void replacementWithPrimitiveVariantsUsingStaticImports() { " Comparator dCmp = comparing(o -> 0.0);", "}") .addOutputLines( - "out/A.java", + "A.java", "import static java.util.Comparator.comparing;", "import static java.util.Comparator.comparingDouble;", "import static java.util.Comparator.comparingInt;", @@ -684,7 +684,7 @@ void replacementWithPrimitiveVariantsUsingStaticImports() { void replacementWithBoxedVariantsUsingStaticImports() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static java.util.Comparator.comparingDouble;", "import static java.util.Comparator.comparingInt;", "import static java.util.Comparator.comparingLong;", @@ -701,7 +701,7 @@ void replacementWithBoxedVariantsUsingStaticImports() { " Comparator dCmp = comparingDouble(o -> Double.valueOf(0));", "}") .addOutputLines( - "out/A.java", + "A.java", "import static java.util.Comparator.comparing;", "import static java.util.Comparator.comparingDouble;", "import static java.util.Comparator.comparingInt;", @@ -725,7 +725,7 @@ void replacementWithBoxedVariantsUsingStaticImports() { void replacementWithPrimitiveVariantsInComplexSyntacticalContext() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import java.util.Comparator;", "", "interface A extends Comparable {", @@ -738,7 +738,7 @@ void replacementWithPrimitiveVariantsInComplexSyntacticalContext() { " Comparator dCmp = Comparator.comparing(o -> o).thenComparing(o -> 0.0);", "}") .addOutputLines( - "out/A.java", + "A.java", "import java.util.Comparator;", "", "interface A extends Comparable {", @@ -757,7 +757,7 @@ void replacementWithPrimitiveVariantsInComplexSyntacticalContext() { void replacementWithBoxedVariantsInComplexSyntacticalContext() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import java.util.Comparator;", "", "interface A extends Comparable {", @@ -775,7 +775,7 @@ void replacementWithBoxedVariantsInComplexSyntacticalContext() { " Comparator.comparing(o -> o).thenComparingDouble(o -> Double.valueOf(0));", "}") .addOutputLines( - "out/A.java", + "A.java", "import java.util.Comparator;", "", "interface A extends Comparable {", 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 d1d22191ec..62f82b3f5a 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 @@ -511,7 +511,7 @@ void identificationOfCustomConversionMethod() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "class A {", " private final Object o = new Object();", " private final String s = o.toString();", @@ -525,7 +525,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "class A {", " private final Object o = new Object();", " private final String s = o.toString();", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsageTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsageTest.java index fd10444a41..20db60b0b6 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsageTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsageTest.java @@ -40,7 +40,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import com.google.errorprone.refaster.Refaster;", "import com.google.errorprone.refaster.annotation.BeforeTemplate;", "", @@ -52,7 +52,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import com.google.errorprone.refaster.Refaster;", "import com.google.errorprone.refaster.annotation.BeforeTemplate;", "", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTraceTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTraceTest.java index 3b37b2c0b6..4753f141b7 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTraceTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTraceTest.java @@ -47,7 +47,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import com.newrelic.api.agent.Trace;", "import org.springframework.scheduling.annotation.Scheduled;", "", @@ -68,7 +68,7 @@ void replacement() { " void scheduledButImproperlyTraced3() {}", "}") .addOutputLines( - "out/A.java", + "A.java", "import com.newrelic.api.agent.Trace;", "import org.springframework.scheduling.annotation.Scheduled;", "", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/Slf4JLogStatementTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/Slf4JLogStatementTest.java index 5c9d98a7ad..6375c76cd2 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/Slf4JLogStatementTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/Slf4JLogStatementTest.java @@ -98,7 +98,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import org.slf4j.Logger;", "import org.slf4j.LoggerFactory;", "import org.slf4j.Marker;", @@ -121,7 +121,7 @@ void replacement() { " }", "}") .addOutputLines( - "out/A.java", + "A.java", "import org.slf4j.Logger;", "import org.slf4j.LoggerFactory;", "import org.slf4j.Marker;", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotationTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotationTest.java index 4527a86ca2..ee47ad2a7f 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotationTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotationTest.java @@ -87,7 +87,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static org.springframework.web.bind.annotation.RequestMethod.PATCH;", "import static org.springframework.web.bind.annotation.RequestMethod.POST;", "import static org.springframework.web.bind.annotation.RequestMethod.PUT;", @@ -117,7 +117,7 @@ void replacement() { " A curly();", "}") .addOutputLines( - "out/A.java", + "A.java", "import static org.springframework.web.bind.annotation.RequestMethod.PATCH;", "import static org.springframework.web.bind.annotation.RequestMethod.POST;", "import static org.springframework.web.bind.annotation.RequestMethod.PUT;", diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportTest.java index 76730bbcad..861ea8421d 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportTest.java @@ -120,7 +120,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/A.java", + "A.java", "import static java.util.function.Predicate.not;", "", "import com.google.common.base.Predicates;", @@ -190,7 +190,7 @@ void replacement() { " final class Test {}", "}") .addOutputLines( - "out/A.java", + "A.java", "import static com.google.common.collect.ImmutableMap.toImmutableMap;", "import static com.google.common.collect.ImmutableSet.toImmutableSet;", "import static com.google.errorprone.BugPattern.LinkType.NONE;", From 60d2bceaede3bfb5454428a5dcddc324cdf2d20f Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Tue, 20 Sep 2022 09:46:52 +0200 Subject: [PATCH 2/3] Simplify another test --- .../errorprone/bugpatterns/CanonicalAnnotationSyntaxTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntaxTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntaxTest.java index a6ae6c673a..e3c9b9e924 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntaxTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntaxTest.java @@ -135,7 +135,7 @@ void identification() { void replacement() { refactoringTestHelper .addInputLines( - "in/pkg/A.java", + "pkg/A.java", "package pkg;", "", "import pkg.A.Foo;", @@ -206,7 +206,7 @@ void replacement() { " A trailingComma3();", "}") .addOutputLines( - "out/pkg/A.java", + "pkg/A.java", "package pkg;", "", "import pkg.A.Foo;", From 7ae5ea4f86689ab53bb8a105f07b4359c16eef4e Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Tue, 20 Sep 2022 22:33:01 +0200 Subject: [PATCH 3/3] Suggestion --- .../bugpatterns/ErrorProneTestHelperSourceFormatTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormatTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormatTest.java index 1ba7a758d1..be6e20306a 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormatTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormatTest.java @@ -44,13 +44,13 @@ void identification() { "", " refactoringTestHelper", " // BUG: Diagnostic contains: Test code should follow the Google Java style", - " .addInputLines(\"in/A.java\", \"class A { }\")", + " .addInputLines(\"A.java\", \"class A { }\")", " // BUG: Diagnostic contains: Test code should follow the Google Java style", - " .addOutputLines(\"out/A.java\", \"class A { }\")", + " .addOutputLines(\"A.java\", \"class A { }\")", " // BUG: Diagnostic contains: Test code should follow the Google Java style", - " .addInputLines(\"in/B.java\", \"import java.util.Map;\", \"\", \"class B {}\")", + " .addInputLines(\"B.java\", \"import java.util.Map;\", \"\", \"class B {}\")", " // Unused import, but in an output file, so not flagged.", - " .addOutputLines(\"out/B.java\", \"import java.util.Map;\", \"\", \"class B {}\")", + " .addOutputLines(\"B.java\", \"import java.util.Map;\", \"\", \"class B {}\")", " .doTest(TestMode.TEXT_MATCH);", " }", "}")