Replace popup with several quick-fixes in ReplaceJavaStaticMethodWithKotlinAnalog

This commit is contained in:
Dmitry Gridin
2019-04-12 20:13:20 +07:00
parent ee304e92b5
commit fd47dc9b88
16 changed files with 97 additions and 49 deletions
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// FIX: Replace with `listOf` function
import java.util.Arrays
fun test() {
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// FIX: Replace with `listOf` function
import java.util.Arrays
fun test() {
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// FIX: Replace with `mutableListOf` function
import java.util.Arrays
fun test() {
val a = Arrays.<caret>asList(1, 3, null)
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// FIX: Replace with `mutableListOf` function
import java.util.Arrays
fun test() {
val a = mutableListOf(1, 3, null)
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
// FIX: Replace with `mtableSetOf` function
fun test() {
val a = java.util.Set.of<caret><String>()
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
// FIX: Replace with `mtableSetOf` function
fun test() {
val a = mutableSetOf<String>()
}
@@ -1,5 +1,6 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
// FIX: Replace with `setOf` function
fun test() {
val a = java.util.Set.of<caret><String>()
@@ -1,5 +1,6 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
// FIX: Replace with `setOf` function
fun test() {
val a = setOf<String>()
@@ -1,5 +1,6 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
// FIX: Replace with `setOf` function
fun test() {
val a = java.util.Set.of<caret>("sfsf", 25)
@@ -1,5 +1,6 @@
// WITH_RUNTIME
// MIN_JAVA_VERSION: 9
// FIX: Replace with `setOf` function
fun test() {
val a = setOf("sfsf", 25)
@@ -1,3 +1,4 @@
// FIX: Replace with `roundToInt` function
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.round(x)
@@ -0,0 +1,7 @@
import kotlin.math.roundToInt
// FIX: Replace with `roundToInt` function
// WITH_RUNTIME
fun test(x: Double) {
x.roundToInt()
}
@@ -0,0 +1,5 @@
// FIX: Replace with `roundToLong` function
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.round(x)
}
@@ -1,5 +1,6 @@
import kotlin.math.roundToLong
// FIX: Replace with `roundToLong` function
// WITH_RUNTIME
fun test(x: Double) {
x.roundToLong()