From 6fab55f031bbd2c92dfccb38db4c79b9239837c5 Mon Sep 17 00:00:00 2001 From: Mikhail Pyltsin Date: Tue, 29 Jul 2025 15:10:26 +0200 Subject: [PATCH] [java-inspection] IDEA-374938 Java: 'Static import can be used' reported for List.of(). - rename title to be clear GitOrigin-RevId: 1c68fe4bc08065136a827a9ef1c7fd949799e7f2 --- .../inspection/staticImportCanBeUsed/AlreadyImported.java | 4 ++-- .../testData/inspection/staticImportCanBeUsed/Simple.java | 4 ++-- .../inspection/staticImportCanBeUsed/SimpleMethod.java | 2 +- .../staticImportCanBeUsed/SimpleMethodOnDemand.java | 2 +- .../inspection/staticImportCanBeUsed/SimpleWithOnDemand.java | 4 ++-- java/openapi/resources/messages/JavaBundle.properties | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/java/java-tests/testData/inspection/staticImportCanBeUsed/AlreadyImported.java b/java/java-tests/testData/inspection/staticImportCanBeUsed/AlreadyImported.java index 23bfa00192fc..f364eef0305d 100644 --- a/java/java-tests/testData/inspection/staticImportCanBeUsed/AlreadyImported.java +++ b/java/java-tests/testData/inspection/staticImportCanBeUsed/AlreadyImported.java @@ -5,7 +5,7 @@ import static java.util.Arrays.sort; class Foo { void test(String[] baz) { - Arrays.sort(baz); - Arrays.sort(baz); + Arrays.sort(baz); + Arrays.sort(baz); } } \ No newline at end of file diff --git a/java/java-tests/testData/inspection/staticImportCanBeUsed/Simple.java b/java/java-tests/testData/inspection/staticImportCanBeUsed/Simple.java index 60b920d59e07..874697efcedd 100644 --- a/java/java-tests/testData/inspection/staticImportCanBeUsed/Simple.java +++ b/java/java-tests/testData/inspection/staticImportCanBeUsed/Simple.java @@ -4,7 +4,7 @@ import java.util.Arrays; class Foo { void test(String[] baz) { - Arrays.sort(baz); - Arrays.sort(baz); + Arrays.sort(baz); + Arrays.sort(baz); } } \ No newline at end of file diff --git a/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleMethod.java b/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleMethod.java index a3be6cd05f80..47dfc2fb96e5 100644 --- a/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleMethod.java +++ b/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleMethod.java @@ -4,7 +4,7 @@ import java.util.Arrays; class Foo { void test(String[] baz) { - Arrays.sort(baz); + Arrays.sort(baz); Arrays.binarySearch(baz, "1"); } } \ No newline at end of file diff --git a/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleMethodOnDemand.java b/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleMethodOnDemand.java index a3be6cd05f80..47dfc2fb96e5 100644 --- a/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleMethodOnDemand.java +++ b/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleMethodOnDemand.java @@ -4,7 +4,7 @@ import java.util.Arrays; class Foo { void test(String[] baz) { - Arrays.sort(baz); + Arrays.sort(baz); Arrays.binarySearch(baz, "1"); } } \ No newline at end of file diff --git a/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleWithOnDemand.java b/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleWithOnDemand.java index 60b920d59e07..874697efcedd 100644 --- a/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleWithOnDemand.java +++ b/java/java-tests/testData/inspection/staticImportCanBeUsed/SimpleWithOnDemand.java @@ -4,7 +4,7 @@ import java.util.Arrays; class Foo { void test(String[] baz) { - Arrays.sort(baz); - Arrays.sort(baz); + Arrays.sort(baz); + Arrays.sort(baz); } } \ No newline at end of file diff --git a/java/openapi/resources/messages/JavaBundle.properties b/java/openapi/resources/messages/JavaBundle.properties index ec7959e2ace5..586cbe815129 100644 --- a/java/openapi/resources/messages/JavaBundle.properties +++ b/java/openapi/resources/messages/JavaBundle.properties @@ -1431,7 +1431,7 @@ inspection.slow.abstract.set.remove.all.fix.family.name=Use 'Set.remove' instead inspection.slow.list.contains.all.description=Call to 'list.containsAll(collection)' may have poor performance inspection.slow.list.contains.all.fix.family.name=Wrap in 'HashSet' constructor inspection.slow.list.contains.all.fix.name=Wrap ''{0}'' in ''HashSet'' constructor -inspection.static.import.can.be.used.display.name=Static import can be used +inspection.static.import.can.be.used.display.name=Static import can be used based on the auto-import table inspection.static.import.can.be.used.fix.name=Add static import slice.filter.parse.error.null.filter.not.applicable.for.primitive.type=''null'' filter is not applicable to primitive type {0} slice.filter.parse.error.not.null.filter.not.applicable.for.primitive.type=''!null'' filter is not applicable to primitive type {0}