Add "Replace with 'equals(..., ignoreCase = true)'" inspection
#KT-40016 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
a5bfa3ae63
commit
d2deff4864
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.ReplaceWithIgnoreCaseEqualsInspection
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun String.test(s: String): Boolean {
|
||||
return <caret>toLowerCase() == s.toLowerCase()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun String.test(s: String): Boolean {
|
||||
return equals(s, ignoreCase = true)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun String.test(s: String): Boolean {
|
||||
return <caret>s.toLowerCase() == toLowerCase()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun String.test(s: String): Boolean {
|
||||
return s.equals(this, ignoreCase = true)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String): Boolean {
|
||||
return <caret>a.toLowerCase() != b.toLowerCase()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String): Boolean {
|
||||
return <caret>a == b.toLowerCase()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String): Boolean {
|
||||
return <caret>a.toLowerCase() == b
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String): Boolean {
|
||||
return <caret>a.toLowerCase() == b.toUpperCase()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String?, b: String): Boolean {
|
||||
return <caret>a?.toLowerCase() == b.toLowerCase()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String?, b: String): Boolean {
|
||||
return a.equals(b, ignoreCase = true)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String?): Boolean {
|
||||
return <caret>a.toLowerCase() == b?.toLowerCase()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String?): Boolean {
|
||||
return a.equals(b, ignoreCase = true)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String?, b: String?): Boolean {
|
||||
return <caret>a?.toLowerCase() == b?.toLowerCase()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String?, b: String?): Boolean {
|
||||
return a.equals(b, ignoreCase = true)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String): Boolean {
|
||||
return <caret>a.toLowerCase() == b.toLowerCase()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String): Boolean {
|
||||
return a.equals(b, ignoreCase = true)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String): Boolean {
|
||||
return <caret>a.toUpperCase() == b.toUpperCase()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(a: String, b: String): Boolean {
|
||||
return a.equals(b, ignoreCase = true)
|
||||
}
|
||||
Reference in New Issue
Block a user