Add Java Arrays.asList, Set.of, List.of to ReplaceJavaStaticMethodWithKotlinAnalogInspection

Relates to #KT-27782 #KT-21641
This commit is contained in:
Dmitry Gridin
2019-04-12 12:05:52 +07:00
parent b5b5723ec3
commit ee304e92b5
13 changed files with 80 additions and 13 deletions
@@ -0,0 +1,6 @@
// WITH_RUNTIME
import java.util.Arrays
fun test() {
val a = Arrays.<caret>asList(1, 3, null)
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
import java.util.Arrays
fun test() {
val a = listOf(1, 3, null)
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
fun test() {
val a = java.util.Set.of<caret><String>()
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
fun test() {
val a = setOf<String>()
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
fun test() {
val a = java.util.Set.of<caret>("sfsf", 25)
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
fun test() {
val a = setOf("sfsf", 25)
}