Introduce "Useless call on collection type" inspection
Related to KT-12165 Supported functions: filterNotNull, filterIsInstance, mapNotNull, mapNotNullTo, mapIndexedNotNull, mapIndexedNotNullTo Also, "Useless cal on not-null" improved a bit
This commit is contained in:
+1
@@ -1,4 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// FIX: Rename useless call to 'isBlank'
|
||||
|
||||
val s: String? = ""
|
||||
val blank = s<caret>?.isNullOrBlank()
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// FIX: Rename useless call to 'isBlank'
|
||||
|
||||
val s: String? = ""
|
||||
val blank = s?.isBlank()
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// FIX: Replace with dot call
|
||||
|
||||
val s: String? = ""
|
||||
val empty = s<caret>?.isNullOrEmpty()
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// FIX: Replace with dot call
|
||||
|
||||
val s: String? = ""
|
||||
val empty = s.isNullOrEmpty()
|
||||
Reference in New Issue
Block a user