From 5a2b2767bb0e3e1ee563c7c5572cc17d6eace747 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Mon, 18 Dec 2023 11:59:30 +0100 Subject: [PATCH] Rename check --- .../errorprone/bugpatterns/MethodReferenceUsage.java | 2 +- ...uggestion.java => UnqualifiedSuggestedFixImport.java} | 9 +++++---- ...nTest.java => UnqualifiedSuggestedFixImportTest.java} | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) rename error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/{ImportSuggestion.java => UnqualifiedSuggestedFixImport.java} (89%) rename error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/{ImportSuggestionTest.java => UnqualifiedSuggestedFixImportTest.java} (91%) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java index 3b812822b41..5c79baf8176 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java @@ -197,7 +197,7 @@ private static ImmutableList getVariables(LambdaExpressionTree tree) { } // XXX: Resolve this suppression. - @SuppressWarnings("ImportSuggestion") + @SuppressWarnings("UnqualifiedSuggestedFixImport") private static Optional constructFix( LambdaExpressionTree lambdaExpr, Symbol target, Object methodName) { Name sName = target.getSimpleName(); diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImportSuggestion.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImport.java similarity index 89% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImportSuggestion.java rename to error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImport.java index 1a52d9ee81f..6d27c7c3723 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImportSuggestion.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImport.java @@ -26,17 +26,18 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Avoid direct invocation of `SuggestedFix#add{,Static}Import`", - link = BUG_PATTERNS_BASE_URL + "ImportSuggestion", + link = BUG_PATTERNS_BASE_URL + "UnqualifiedSuggestedFixImport", linkType = CUSTOM, severity = WARNING, tags = FRAGILE_CODE) -public final class ImportSuggestion extends BugChecker implements MethodInvocationTreeMatcher { +public final class UnqualifiedSuggestedFixImport extends BugChecker + implements MethodInvocationTreeMatcher { private static final long serialVersionUID = 1L; private static final Matcher FIX_BUILDER_METHOD = instanceMethod().onDescendantOf(SuggestedFix.Builder.class.getCanonicalName()); - /** Instantiates a new {@link ImportSuggestion} instance. */ - public ImportSuggestion() {} + /** Instantiates a new {@link UnqualifiedSuggestedFixImport} instance. */ + public UnqualifiedSuggestedFixImport() {} @Override public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ImportSuggestionTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImportTest.java similarity index 91% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ImportSuggestionTest.java rename to error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImportTest.java index d719e838d65..c414af3adc0 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/ImportSuggestionTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/UnqualifiedSuggestedFixImportTest.java @@ -3,10 +3,10 @@ import com.google.errorprone.CompilationTestHelper; import org.junit.jupiter.api.Test; -final class ImportSuggestionTest { +final class UnqualifiedSuggestedFixImportTest { @Test void identification() { - CompilationTestHelper.newInstance(ImportSuggestion.class, getClass()) + CompilationTestHelper.newInstance(UnqualifiedSuggestedFixImport.class, getClass()) .expectErrorMessage( "IMPORT", m ->