filterNotNullTo supported
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterNotNullTo()'"
|
||||
fun foo(list: List<String?>, target: MutableCollection<String>) {
|
||||
<caret>for (s in list) {
|
||||
if (s != null) {
|
||||
target.add(s)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterNotNullTo()'"
|
||||
fun foo(list: List<String?>, target: MutableCollection<String>) {
|
||||
<caret>list.filterNotNullTo(target)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterNotNullTo()'"
|
||||
import java.util.ArrayList
|
||||
|
||||
fun foo(list: List<String?>) {
|
||||
val target = ArrayList<String>(1000)
|
||||
<caret>for (s in list) {
|
||||
if (s != null) {
|
||||
target.add(s)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterNotNullTo()'"
|
||||
import java.util.ArrayList
|
||||
|
||||
fun foo(list: List<String?>) {
|
||||
val <caret>target = list.filterNotNullTo(ArrayList<String>(1000))
|
||||
}
|
||||
Reference in New Issue
Block a user