Rename ReplaceJavaStaticMethodWithTopLevelFunctionInspection to ReplaceJavaStaticMethodWithKotlinAnalogInspection

This commit is contained in:
Dmitry Gridin
2019-04-11 13:15:01 +07:00
parent 23003c5d1a
commit b5b5723ec3
123 changed files with 83 additions and 83 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.ReplaceJavaStaticMethodWithKotlinAnalogInspection
@@ -0,0 +1,10 @@
// PROBLEM: none
class A {
fun copyOf(x: Int, y: Int) {
}
}
fun test() {
A().<caret>copyOf(1, 2)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun test() {
val array = intArrayOf(1, 2, 3)
val result = java.util.Arrays.<caret>copyOf(array, 3)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun test() {
val array = intArrayOf(1, 2, 3)
val result = array.copyOf(3)
}
@@ -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)
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
import java.util.Arrays
fun test() {
val array = intArrayOf(1, 2, 3)
val result = array.copyOf(3)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Byte.<caret>compare(5, 6)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.compareTo(6)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Character.<caret>compare('3', '4')
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = '3'.compareTo('4')
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Double.<caret>compare(5.0, 6.0)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.0.compareTo(6.0)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Float.<caret>compare(5.0, 6.0)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.0.compareTo(6.0)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = Integer.<caret>compare(5, 6)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.compareTo(6)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Long.<caret>compare(5, 6)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.compareTo(6)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Short.<caret>compare(5, 6)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.compareTo(6)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
<caret>System.out.print("foo")
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
print("foo")
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
<caret>System.out.println()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
println()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
System.out.println<caret>("foo")
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
println("foo")
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
System.out.println<caret>("foo").let { it }
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
println("foo").let { it }
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.IEEEremainder(x, y)
}
@@ -0,0 +1,6 @@
import kotlin.math.IEEErem
// WITH_RUNTIME
fun test(x: Double, y: Double) {
x.IEEErem(y)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.abs(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.abs
// WITH_RUNTIME
fun test(x: Double) {
abs(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.acos(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.acos
// WITH_RUNTIME
fun test(x: Double) {
acos(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.asin(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.asin
// WITH_RUNTIME
fun test(x: Double) {
asin(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.atan(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.atan
// WITH_RUNTIME
fun test(x: Double) {
atan(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.atan2(x, y)
}
@@ -0,0 +1,6 @@
import kotlin.math.atan2
// WITH_RUNTIME
fun test(x: Double, y: Double) {
atan2(x, y)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.ceil(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.ceil
// WITH_RUNTIME
fun test(x: Double) {
ceil(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.copySign(x, y)
}
@@ -0,0 +1,6 @@
import kotlin.math.withSign
// WITH_RUNTIME
fun test(x: Double, y: Double) {
x.withSign(y)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.cos(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.cos
// WITH_RUNTIME
fun test(x: Double) {
cos(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.cosh(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.cosh
// WITH_RUNTIME
fun test(x: Double) {
cosh(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.exp(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.exp
// WITH_RUNTIME
fun test(x: Double) {
exp(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.expm1(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.expm1
// WITH_RUNTIME
fun test(x: Double) {
expm1(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.floor(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.floor
// WITH_RUNTIME
fun test(x: Double) {
floor(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.hypot(x, y)
}
@@ -0,0 +1,6 @@
import kotlin.math.hypot
// WITH_RUNTIME
fun test(x: Double, y: Double) {
hypot(x, y)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.log(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.ln
// WITH_RUNTIME
fun test(x: Double) {
<caret>ln(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.log10(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.log10
// WITH_RUNTIME
fun test(x: Double) {
log10(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.log1p(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.ln1p
// WITH_RUNTIME
fun test(x: Double) {
<caret>ln1p(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.max(x, y)
}
@@ -0,0 +1,6 @@
import kotlin.math.max
// WITH_RUNTIME
fun test(x: Double, y: Double) {
max(x, y)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.min(x, y)
}
@@ -0,0 +1,6 @@
import kotlin.math.min
// WITH_RUNTIME
fun test(x: Double, y: Double) {
min(x, y)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.nextAfter(x, y)
}
@@ -0,0 +1,6 @@
import kotlin.math.nextTowards
// WITH_RUNTIME
fun test(x: Double, y: Double) {
x.nextTowards(y)
}
@@ -0,0 +1,4 @@
// RUNTIME_WITH_FULL_JDK
fun test(x: Double) {
<caret>Math.nextDown(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.nextDown
// RUNTIME_WITH_FULL_JDK
fun test(x: Double) {
x.nextDown()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.nextUp(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.nextUp
// WITH_RUNTIME
fun test(x: Double) {
x.nextUp()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double, y: Double) {
<caret>Math.pow(x, y)
}
@@ -0,0 +1,6 @@
import kotlin.math.pow
// WITH_RUNTIME
fun test(x: Double, y: Double) {
x.pow(y)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.rint(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.round
// WITH_RUNTIME
fun test(x: Double) {
round(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.round(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.roundToLong
// WITH_RUNTIME
fun test(x: Double) {
x.roundToLong()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.signum(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.sign
// WITH_RUNTIME
fun test(x: Double) {
sign(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.sin(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.sin
// WITH_RUNTIME
fun test(x: Double) {
sin(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.sinh(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.sinh
// WITH_RUNTIME
fun test(x: Double) {
sinh(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.sqrt(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.sqrt
// WITH_RUNTIME
fun test(x: Double) {
sqrt(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.tan(x)
}
@@ -0,0 +1,6 @@
import kotlin.math.tan
// WITH_RUNTIME
fun test(x: Double) {
tan(x)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
// WITH_RUNTIME
fun test(x: Double) {
<caret>Math.tanh(x)
}
@@ -0,0 +1,7 @@
import kotlin.math.tanh
// WITH_RUNTIME
// WITH_RUNTIME
fun test(x: Double) {
tanh(x)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test() {
<caret>System.exit(0)
}
@@ -0,0 +1,6 @@
import kotlin.system.exitProcess
// WITH_RUNTIME
fun test() {
exitProcess(0)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Byte.<caret>toString(5) + 6
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.toString() + 6
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Character.<caret>toString('3') + 6
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = '3'.toString() + 6
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Double.<caret>toString(5.0)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.0.toString()
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = java.lang.Float.<caret>toString(5.0)
}
@@ -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