From 58b4770d49ab74cbf66c19d8c0c3f3ad3191a9c2 Mon Sep 17 00:00:00 2001 From: "Victoria.Petrakovich" Date: Thu, 28 Aug 2025 17:15:14 +0200 Subject: [PATCH] [kotlin] Add test with mutable list ^KTIJ-31955 Fixed GitOrigin-RevId: 3bcf5bca06237c08d54e4528f382cf09ea476c2b --- .../shared/SharedK1LocalInspectionTestGenerated.java | 5 +++++ .../shared/SharedK2LocalInspectionTestGenerated.java | 5 +++++ .../reverseMutableList.kt | 8 ++++++++ 3 files changed, 18 insertions(+) create mode 100644 plugins/kotlin/code-insight/inspections-shared/tests/testData/inspectionsLocal/javaCollectionsStaticMethodOnImmutableList/reverseMutableList.kt diff --git a/plugins/kotlin/code-insight/inspections-shared/tests/k1/test/org/jetbrains/kotlin/idea/codeInsight/inspections/shared/SharedK1LocalInspectionTestGenerated.java b/plugins/kotlin/code-insight/inspections-shared/tests/k1/test/org/jetbrains/kotlin/idea/codeInsight/inspections/shared/SharedK1LocalInspectionTestGenerated.java index f5bb1476834d..092c07fb550f 100644 --- a/plugins/kotlin/code-insight/inspections-shared/tests/k1/test/org/jetbrains/kotlin/idea/codeInsight/inspections/shared/SharedK1LocalInspectionTestGenerated.java +++ b/plugins/kotlin/code-insight/inspections-shared/tests/k1/test/org/jetbrains/kotlin/idea/codeInsight/inspections/shared/SharedK1LocalInspectionTestGenerated.java @@ -1784,6 +1784,11 @@ public abstract class SharedK1LocalInspectionTestGenerated extends AbstractShare public void testReverseImmutableList() throws Exception { runTest("../testData/inspectionsLocal/javaCollectionsStaticMethodOnImmutableList/reverseImmutableList.kt"); } + + @TestMetadata("reverseMutableList.kt") + public void testReverseMutableList() throws Exception { + runTest("../testData/inspectionsLocal/javaCollectionsStaticMethodOnImmutableList/reverseMutableList.kt"); + } } @RunWith(JUnit3RunnerWithInners.class) diff --git a/plugins/kotlin/code-insight/inspections-shared/tests/k2/test/org/jetbrains/kotlin/idea/k2/codeInsight/inspections/shared/SharedK2LocalInspectionTestGenerated.java b/plugins/kotlin/code-insight/inspections-shared/tests/k2/test/org/jetbrains/kotlin/idea/k2/codeInsight/inspections/shared/SharedK2LocalInspectionTestGenerated.java index 73f8b81b3ac6..be108dec56d6 100644 --- a/plugins/kotlin/code-insight/inspections-shared/tests/k2/test/org/jetbrains/kotlin/idea/k2/codeInsight/inspections/shared/SharedK2LocalInspectionTestGenerated.java +++ b/plugins/kotlin/code-insight/inspections-shared/tests/k2/test/org/jetbrains/kotlin/idea/k2/codeInsight/inspections/shared/SharedK2LocalInspectionTestGenerated.java @@ -1784,6 +1784,11 @@ public abstract class SharedK2LocalInspectionTestGenerated extends AbstractShare public void testReverseImmutableList() throws Exception { runTest("../testData/inspectionsLocal/javaCollectionsStaticMethodOnImmutableList/reverseImmutableList.kt"); } + + @TestMetadata("reverseMutableList.kt") + public void testReverseMutableList() throws Exception { + runTest("../testData/inspectionsLocal/javaCollectionsStaticMethodOnImmutableList/reverseMutableList.kt"); + } } @RunWith(JUnit3RunnerWithInners.class) diff --git a/plugins/kotlin/code-insight/inspections-shared/tests/testData/inspectionsLocal/javaCollectionsStaticMethodOnImmutableList/reverseMutableList.kt b/plugins/kotlin/code-insight/inspections-shared/tests/testData/inspectionsLocal/javaCollectionsStaticMethodOnImmutableList/reverseMutableList.kt new file mode 100644 index 000000000000..6afadd67e84b --- /dev/null +++ b/plugins/kotlin/code-insight/inspections-shared/tests/testData/inspectionsLocal/javaCollectionsStaticMethodOnImmutableList/reverseMutableList.kt @@ -0,0 +1,8 @@ +// WITH_STDLIB +// PROBLEM: none +import java.util.Collections + +fun test() { + val mutableList = mutableListOf(1, 2) + Collections.reverse(mutableList) +}