Merge ReplaceMathMaxWithCoerceAtLeastIntention & ReplaceMathMinWithCoerceAtMostIntention with ReplaceJavaStaticMethodWithKotlinAnalogInspection
Relates to #KT-31502
This commit is contained in:
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with `coerceAtLeast` function
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.max(x, y)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with `coerceAtLeast` function
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
x.coerceAtLeast(y)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with `coerceAtMost` function
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.min(x, y)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with `coerceAtMost` function
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
x.coerceAtMost(y)
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIX: Replace with `max` function
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.max(x, y)
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
import kotlin.math.max
|
||||
|
||||
// FIX: Replace with `max` function
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
max(x, y)
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIX: Replace with `min` function
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.min(x, y)
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
import kotlin.math.min
|
||||
|
||||
// FIX: Replace with `min` function
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
min(x, y)
|
||||
|
||||
Reference in New Issue
Block a user