mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
replace with collect: collapse lambda to method reference in filters (IDEA-151491)
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with collect" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class A {
|
||||
private void withStream(List<String> stream, final List<String> activeFilters) {
|
||||
activeFilters.addAll(stream.stream().filter(String::isEmpty).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with collect" "true"
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class A {
|
||||
private void withStream(List<String> stream, final List<String> activeFilters) {
|
||||
for (String filter : st<caret>ream)
|
||||
if (filter.isEmpty()) {
|
||||
activeFilters.add(filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user