Inspection to replace !string.isBlank() with string.isNotBlank()
#KT-40769 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
f9a2d01d57
commit
d09b20f11d
+5
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(s: String) {
|
||||
val b = s.isBlank<caret>()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// PROBLEM: Replace negated 'isBlank' with 'isNotBlank'
|
||||
// FIX: Replace negated 'isBlank' with 'isNotBlank'
|
||||
// WITH_RUNTIME
|
||||
fun test(s: String) {
|
||||
val b = !s.isBlank<caret>()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// PROBLEM: Replace negated 'isBlank' with 'isNotBlank'
|
||||
// FIX: Replace negated 'isBlank' with 'isNotBlank'
|
||||
// WITH_RUNTIME
|
||||
fun test(s: String) {
|
||||
val b = s.isNotBlank()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// PROBLEM: Replace negated 'isNotBlank' with 'isBlank'
|
||||
// FIX: Replace negated 'isNotBlank' with 'isBlank'
|
||||
// WITH_RUNTIME
|
||||
fun test(s: String) {
|
||||
val b = !s.isNotBlank<caret>()
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// PROBLEM: Replace negated 'isNotBlank' with 'isBlank'
|
||||
// FIX: Replace negated 'isNotBlank' with 'isBlank'
|
||||
// WITH_RUNTIME
|
||||
fun test(s: String) {
|
||||
val b = s.isBlank()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(s: String) {
|
||||
<caret>if (s.isBlank()) {
|
||||
foo(1)
|
||||
} else {
|
||||
foo(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(s: String) {
|
||||
<caret>if (s.isNotBlank()) {
|
||||
foo(2)
|
||||
} else {
|
||||
foo(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(s: String) {
|
||||
<caret>if (s.isNotBlank()) {
|
||||
foo(1)
|
||||
} else {
|
||||
foo(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(s: String) {
|
||||
<caret>if (s.isBlank()) {
|
||||
foo(2)
|
||||
} else {
|
||||
foo(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(s: String) {
|
||||
<caret>if (!s.isBlank()) {
|
||||
foo(1)
|
||||
} else {
|
||||
foo(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(s: String) {
|
||||
<caret>if (s.isBlank()) {
|
||||
foo(2)
|
||||
} else {
|
||||
foo(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(s: String) {
|
||||
<caret>if (!s.isNotBlank()) {
|
||||
foo(1)
|
||||
} else {
|
||||
foo(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(s: String) {
|
||||
<caret>if (s.isNotBlank()) {
|
||||
foo(2)
|
||||
} else {
|
||||
foo(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user