Array equality: replace Arrays.equals with contentEquals in intention
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '==' with 'Arrays.equals'
|
||||
// INTENTION_TEXT: Replace '==' with 'contentEquals'
|
||||
fun foo() {
|
||||
val a = arrayOf("a", "b", "c")
|
||||
val b = arrayOf("a", "b", "c")
|
||||
|
||||
+2
-4
@@ -1,10 +1,8 @@
|
||||
import java.util.Arrays
|
||||
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '==' with 'Arrays.equals'
|
||||
// INTENTION_TEXT: Replace '==' with 'contentEquals'
|
||||
fun foo() {
|
||||
val a = arrayOf("a", "b", "c")
|
||||
val b = arrayOf("a", "b", "c")
|
||||
if (Arrays.equals(a, b)) {
|
||||
if (a.contentEquals(b)) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '!=' with 'Arrays.equals'
|
||||
// INTENTION_TEXT: Replace '!=' with 'contentEquals'
|
||||
fun foo() {
|
||||
val a = arrayOf("a", "b", "c")
|
||||
val b = arrayOf("a", "b", "c")
|
||||
|
||||
+2
-4
@@ -1,10 +1,8 @@
|
||||
import java.util.Arrays
|
||||
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '!=' with 'Arrays.equals'
|
||||
// INTENTION_TEXT: Replace '!=' with 'contentEquals'
|
||||
fun foo() {
|
||||
val a = arrayOf("a", "b", "c")
|
||||
val b = arrayOf("a", "b", "c")
|
||||
if (!Arrays.equals(a, b)) {
|
||||
if (!a.contentEquals(b)) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '==' with 'Arrays.equals'
|
||||
// INTENTION_TEXT: Replace '==' with 'contentEquals'
|
||||
fun foo() {
|
||||
val a = charArrayOf('a', 'b', 'c')
|
||||
val b = charArrayOf('a', 'b', 'c')
|
||||
|
||||
Vendored
+2
-4
@@ -1,10 +1,8 @@
|
||||
import java.util.Arrays
|
||||
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '==' with 'Arrays.equals'
|
||||
// INTENTION_TEXT: Replace '==' with 'contentEquals'
|
||||
fun foo() {
|
||||
val a = charArrayOf('a', 'b', 'c')
|
||||
val b = charArrayOf('a', 'b', 'c')
|
||||
if (Arrays.equals(a, b)) {
|
||||
if (a.contentEquals(b)) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user