Rename ReplaceJavaStaticMethodWithTopLevelFunctionInspection to ReplaceJavaStaticMethodWithKotlinAnalogInspection
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.ReplaceJavaStaticMethodWithKotlinAnalogInspection
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class A {
|
||||
fun copyOf(x: Int, y: Int) {
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A().<caret>copyOf(1, 2)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val array = intArrayOf(1, 2, 3)
|
||||
val result = java.util.Arrays.<caret>copyOf(array, 3)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val array = intArrayOf(1, 2, 3)
|
||||
val result = array.copyOf(3)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
import java.util.Arrays
|
||||
|
||||
fun test() {
|
||||
val array = intArrayOf(1, 2, 3)
|
||||
val result = Arrays.<caret>copyOf(array, 3)
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
import java.util.Arrays
|
||||
|
||||
fun test() {
|
||||
val array = intArrayOf(1, 2, 3)
|
||||
val result = array.copyOf(3)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Byte.<caret>compare(5, 6)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.compareTo(6)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Character.<caret>compare('3', '4')
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = '3'.compareTo('4')
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Double.<caret>compare(5.0, 6.0)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.0.compareTo(6.0)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Float.<caret>compare(5.0, 6.0)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.0.compareTo(6.0)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = Integer.<caret>compare(5, 6)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.compareTo(6)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Long.<caret>compare(5, 6)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.compareTo(6)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Short.<caret>compare(5, 6)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.compareTo(6)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
<caret>System.out.print("foo")
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
print("foo")
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
<caret>System.out.println()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
println()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
System.out.println<caret>("foo")
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
println("foo")
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
System.out.println<caret>("foo").let { it }
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
println("foo").let { it }
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.IEEEremainder(x, y)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.IEEErem
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
x.IEEErem(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.abs(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.abs
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
abs(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.acos(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.acos
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
acos(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.asin(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.asin
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
asin(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.atan(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.atan
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
atan(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.atan2(x, y)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.atan2
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
atan2(x, y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.ceil(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.ceil
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
ceil(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.copySign(x, y)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.withSign
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
x.withSign(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.cos(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.cos
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
cos(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.cosh(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.cosh
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
cosh(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.exp(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.exp
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
exp(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.expm1(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.expm1
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
expm1(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.floor(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.floor
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
floor(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.hypot(x, y)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.hypot
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
hypot(x, y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.log(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.ln
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>ln(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.log10(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.log10
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
log10(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.log1p(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.ln1p
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>ln1p(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.max(x, y)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.max
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
max(x, y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.min(x, y)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.min
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
min(x, y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.nextAfter(x, y)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.nextTowards
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
x.nextTowards(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// RUNTIME_WITH_FULL_JDK
|
||||
fun test(x: Double) {
|
||||
<caret>Math.nextDown(x)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.nextDown
|
||||
|
||||
// RUNTIME_WITH_FULL_JDK
|
||||
fun test(x: Double) {
|
||||
x.nextDown()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.nextUp(x)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.nextUp
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
x.nextUp()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
<caret>Math.pow(x, y)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.pow
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double, y: Double) {
|
||||
x.pow(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.rint(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.round
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
round(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.round(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.roundToLong
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
x.roundToLong()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.signum(x)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.sign
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
sign(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.sin(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.sin
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
sin(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.sinh(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.sinh
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
sinh(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.sqrt(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.sqrt
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
sqrt(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.tan(x)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.math.tan
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
tan(x)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
<caret>Math.tanh(x)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import kotlin.math.tanh
|
||||
|
||||
// WITH_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
fun test(x: Double) {
|
||||
tanh(x)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
<caret>System.exit(0)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
exitProcess(0)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Byte.<caret>toString(5) + 6
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.toString() + 6
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Character.<caret>toString('3') + 6
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = '3'.toString() + 6
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Double.<caret>toString(5.0)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.0.toString()
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = java.lang.Float.<caret>toString(5.0)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val t = 5.0.toString()
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user