mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-02 04:35:22 +07:00
[kotlin] Java methods should be replaced with Kotlin analog: don't report for Arrays.equals when the parameter isn't two
#KTIJ-19298 Fixed closes https://github.com/JetBrains/intellij-community/pull/1689 GitOrigin-RevId: a24f0daf11e485e5f7d66bf287fb77c357260fda
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c9632a3978
commit
4e5a8e2736
+3
-1
@@ -156,7 +156,9 @@ class ReplaceJavaStaticMethodWithKotlinAnalogInspection : AbstractKotlinInspecti
|
||||
it.valueArguments.size == 2
|
||||
},
|
||||
Replacement("java.util.Arrays.copyOfRange", "kotlin.collections.copyOfRange", ToExtensionFunctionWithNonNullableReceiver),
|
||||
Replacement("java.util.Arrays.equals", "kotlin.collections.contentEquals", ToExtensionFunctionWithNonNullableArguments),
|
||||
Replacement("java.util.Arrays.equals", "kotlin.collections.contentEquals", ToExtensionFunctionWithNonNullableArguments) {
|
||||
it.valueArguments.size == 2
|
||||
},
|
||||
Replacement("java.util.Arrays.deepEquals", "kotlin.collections.contentDeepEquals", ToExtensionFunctionWithNonNullableArguments),
|
||||
Replacement(
|
||||
"java.util.Arrays.deepHashCode",
|
||||
|
||||
+5
@@ -11379,6 +11379,11 @@ public abstract class LocalInspectionTestGenerated extends AbstractLocalInspecti
|
||||
runTest("testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/equalsWithEOLComment.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("equalsWithIndex.kt")
|
||||
public void testEqualsWithIndex() throws Exception {
|
||||
runTest("testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/equalsWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("equalsWithNullOther.kt")
|
||||
public void testEqualsWithNullOther() throws Exception {
|
||||
runTest("testData/inspectionsLocal/replaceJavaStaticMethodWithKotlinAnalog/collections/equalsWithNullOther.kt");
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
// RUNTIME_WITH_FULL_JDK
|
||||
import java.util.Arrays
|
||||
|
||||
fun test() {
|
||||
val a = arrayOf(1, 2, 3)
|
||||
val b = arrayOf(1, 2, 3)
|
||||
val result = Arrays.<caret>equals(a, 1, 2, b, 1, 2)
|
||||
}
|
||||
Reference in New Issue
Block a user