ReplaceJavaStaticMethodWithKotlinAnalogInspection: remove non-implemented cases
This commit is contained in:
+11
-10
@@ -81,9 +81,10 @@ class ReplaceJavaStaticMethodWithKotlinAnalogInspection : AbstractKotlinInspecti
|
|||||||
Replacement("java.io.PrintStream.println", "kotlin.io.println", filter = ::isJavaSystemOut)
|
Replacement("java.io.PrintStream.println", "kotlin.io.println", filter = ::isJavaSystemOut)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO: implement Transformation for mapping
|
||||||
private val JAVA_SYSTEM = listOf(
|
private val JAVA_SYSTEM = listOf(
|
||||||
Replacement("java.lang.System.exit", "kotlin.system.exitProcess"),
|
Replacement("java.lang.System.exit", "kotlin.system.exitProcess")
|
||||||
Replacement("java.lang.System.arraycopy", "kotlin.collections.copyInto", ToExtensionFunction) // TODO: mapping
|
// Replacement("java.lang.System.arraycopy", "kotlin.collections.copyInto", ToExtensionFunction)
|
||||||
)
|
)
|
||||||
|
|
||||||
private val JAVA_MATH = listOf(
|
private val JAVA_MATH = listOf(
|
||||||
@@ -128,16 +129,16 @@ class ReplaceJavaStaticMethodWithKotlinAnalogInspection : AbstractKotlinInspecti
|
|||||||
it.valueArguments.size == 2
|
it.valueArguments.size == 2
|
||||||
},
|
},
|
||||||
Replacement("java.util.Arrays.copyOfRange", "kotlin.collections.copyOfRange", ToExtensionFunction),
|
Replacement("java.util.Arrays.copyOfRange", "kotlin.collections.copyOfRange", ToExtensionFunction),
|
||||||
Replacement("java.util.Arrays.binarySearch", "kotlin.collections.binarySearch", ToExtensionFunction), // TODO: mapping
|
// Replacement("java.util.Arrays.binarySearch", "kotlin.collections.binarySearch", ToExtensionFunction),
|
||||||
Replacement("java.util.Arrays.equals", "kotlin.collections.contentEquals", ToExtensionFunction),
|
Replacement("java.util.Arrays.equals", "kotlin.collections.contentEquals", ToExtensionFunction),
|
||||||
Replacement("java.util.Arrays.deepEquals", "kotlin.collections.contentDeepEquals", ToExtensionFunction),
|
Replacement("java.util.Arrays.deepEquals", "kotlin.collections.contentDeepEquals", ToExtensionFunction),
|
||||||
Replacement("java.util.Arrays.fill", "kotlin.collections.fill", ToExtensionFunction), // TODO: mapping
|
// Replacement("java.util.Arrays.fill", "kotlin.collections.fill", ToExtensionFunction),
|
||||||
Replacement("java.util.Arrays.sort", "kotlin.collections.sort", ToExtensionFunction) {
|
// Replacement("java.util.Arrays.sort", "kotlin.collections.sort", ToExtensionFunction) {
|
||||||
it.valueArguments.size == 3
|
// it.valueArguments.size == 3
|
||||||
}, //TODO: mapping?
|
// },
|
||||||
Replacement("java.util.Arrays.sort", "kotlin.collections.sortWith", ToExtensionFunction) {
|
// Replacement("java.util.Arrays.sort", "kotlin.collections.sortWith", ToExtensionFunction) {
|
||||||
it.valueArguments.size != 3
|
// it.valueArguments.size != 3
|
||||||
},
|
// },
|
||||||
Replacement("java.util.Arrays.deepHashCode", "kotlin.collections.contentDeepHashCode", ToExtensionFunction),
|
Replacement("java.util.Arrays.deepHashCode", "kotlin.collections.contentDeepHashCode", ToExtensionFunction),
|
||||||
Replacement("java.util.Arrays.hashCode", "kotlin.collections.contentHashCode", ToExtensionFunction),
|
Replacement("java.util.Arrays.hashCode", "kotlin.collections.contentHashCode", ToExtensionFunction),
|
||||||
Replacement("java.util.Arrays.deepToString", "kotlin.collections.contentDeepToString", ToExtensionFunction),
|
Replacement("java.util.Arrays.deepToString", "kotlin.collections.contentDeepToString", ToExtensionFunction),
|
||||||
|
|||||||
Vendored
-7
@@ -1,7 +0,0 @@
|
|||||||
// WITH_RUNTIME
|
|
||||||
import java.util.Arrays
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val array = arrayOf(1, 2, 3)
|
|
||||||
val result = Arrays.<caret>binarySearch(array, 3)
|
|
||||||
}
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
// WITH_RUNTIME
|
|
||||||
import java.util.Arrays
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val array = arrayOf(1, 2, 3)
|
|
||||||
val result = array.binarySearch(3)
|
|
||||||
}
|
|
||||||
Vendored
-9
@@ -1,9 +0,0 @@
|
|||||||
// WITH_RUNTIME
|
|
||||||
import java.util.Arrays
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val array = arrayOf(1, 2, 3)
|
|
||||||
val from = 1
|
|
||||||
val to = 4
|
|
||||||
val result = Arrays.<caret>binarySearch(array, from, to, 3)
|
|
||||||
}
|
|
||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
// WITH_RUNTIME
|
|
||||||
import java.util.Arrays
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val array = arrayOf(1, 2, 3)
|
|
||||||
val key = 3
|
|
||||||
val from = 1
|
|
||||||
val to = 4
|
|
||||||
val result = array.binarySearch(key, from, to)
|
|
||||||
}
|
|
||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
// WITH_RUNTIME
|
|
||||||
fun test() {
|
|
||||||
val a = arrayOf(2)
|
|
||||||
val b = arrayOf(4)
|
|
||||||
val aOffset = 1
|
|
||||||
val bOffset = 2
|
|
||||||
val len = 5
|
|
||||||
java.lang.System.<caret>arraycopy(a, aOffset, b, bOffset, len)
|
|
||||||
}
|
|
||||||
Vendored
-9
@@ -1,9 +0,0 @@
|
|||||||
// WITH_RUNTIME
|
|
||||||
fun test() {
|
|
||||||
val a = arrayOf(2)
|
|
||||||
val b = arrayOf(4)
|
|
||||||
val aOffset = 1
|
|
||||||
val bOffset = 2
|
|
||||||
val len = 5
|
|
||||||
a.copyInto(b, bOffset, aOffset, len + aOffset)
|
|
||||||
}
|
|
||||||
-15
@@ -9061,16 +9061,6 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
|
|||||||
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/asList.kt");
|
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/asList.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("binarySearch.kt")
|
|
||||||
public void testBinarySearch() throws Exception {
|
|
||||||
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/binarySearch.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("binarySearch2.kt")
|
|
||||||
public void testBinarySearch2() throws Exception {
|
|
||||||
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/binarySearch2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("copyOf.kt")
|
@TestMetadata("copyOf.kt")
|
||||||
public void testCopyOf() throws Exception {
|
public void testCopyOf() throws Exception {
|
||||||
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/copyOf.kt");
|
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/copyOf.kt");
|
||||||
@@ -9438,11 +9428,6 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), TargetBackend.ANY, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), TargetBackend.ANY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("arraycopy.kt")
|
|
||||||
public void testArraycopy() throws Exception {
|
|
||||||
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system/arraycopy.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("exit.kt")
|
@TestMetadata("exit.kt")
|
||||||
public void testExit() throws Exception {
|
public void testExit() throws Exception {
|
||||||
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system/exit.kt");
|
runTest("idea/testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/system/exit.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user