Inspection to convert Arrays.copyOf(a, size) to a.copyOf(size)
This commit is contained in:
committed by
Nikolay Krasko
parent
fc4f7303d3
commit
e6de8e9cd3
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.ReplaceArraysCopyOfWithCopyOfInspection
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class A {
|
||||
fun copyOf(x: Int, y: Int) {
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A().<caret>copyOf(1, 2)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
import java.util.Arrays
|
||||
|
||||
fun test() {
|
||||
val array = intArrayOf(1, 2, 3)
|
||||
val result = <caret>Arrays.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)
|
||||
}
|
||||
Reference in New Issue
Block a user