Add inspection for converting !collection.isEmpty() -> isNotEmpty()

#KT-27556 Fixed
This commit is contained in:
kenji tomita
2018-11-17 03:37:38 +03:00
committed by Mikhail Glukhikh
parent 538a746df9
commit 7b43d5c972
7 changed files with 131 additions and 0 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.ReplaceNegatedIsEmptyWithIsNotEmptyInspection
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// FIX: Replace negated 'isEmpty' with 'isNotEmpty'
fun test() {
val list = listOf(1,2,3)
if (!list.<caret>isEmpty()) {
}
}
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// FIX: Replace negated 'isEmpty' with 'isNotEmpty'
fun test() {
val list = listOf(1,2,3)
if (list.isNotEmpty()) {
}
}