From 6ccd2a01766e02ea8ba2d7150062c3bf15ce676d 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 3b812822b4..5c79baf817 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 1a52d9ee81..6d27c7c372 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 d719e838d6..c414af3adc 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 ->