Array equality: replace Arrays.equals with contentEquals in intention

This commit is contained in:
Mikhail Glukhikh
2017-09-25 16:27:51 +03:00
parent 32531b3afc
commit 253ae10e5f
7 changed files with 12 additions and 25 deletions
@@ -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")
@@ -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,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")
@@ -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,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')
@@ -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)) {
}
}