Merge ReplaceMathMaxWithCoerceAtLeastIntention & ReplaceMathMinWithCoerceAtMostIntention with ReplaceJavaStaticMethodWithKotlinAnalogInspection

Relates to #KT-31502
This commit is contained in:
Dmitry Gridin
2019-05-27 18:01:53 +07:00
parent 26478b1374
commit d3339cae46
51 changed files with 36 additions and 412 deletions
@@ -0,0 +1,5 @@
// FIX: Replace with `coerceAtLeast` function
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.max(x, y)
}
@@ -0,0 +1,5 @@
// FIX: Replace with `coerceAtLeast` function
// WITH_RUNTIME
fun test(x: Double, y: Double) {
x.coerceAtLeast(y)
}
@@ -0,0 +1,5 @@
// FIX: Replace with `coerceAtMost` function
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.min(x, y)
}
@@ -0,0 +1,5 @@
// FIX: Replace with `coerceAtMost` function
// WITH_RUNTIME
fun test(x: Double, y: Double) {
x.coerceAtMost(y)
}
@@ -1,3 +1,4 @@
// FIX: Replace with `max` function
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.max(x, y)
@@ -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,3 +1,4 @@
// FIX: Replace with `min` function
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.min(x, y)
@@ -1,5 +1,6 @@
import kotlin.math.min
// FIX: Replace with `min` function
// WITH_RUNTIME
fun test(x: Double, y: Double) {
min(x, y)