mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
CollectMigration: prepare to IncorporateStreamOperationsInspection; fix NewListTerminal to support collections only
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with collect" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Test {
|
||||
MyObj test(List<String> list) {
|
||||
List<String> res = list.stream().filter(s -> !s.isEmpty()).collect(Collectors.toList());
|
||||
return new MyObj(res);
|
||||
}
|
||||
|
||||
private class MyObj {
|
||||
public MyObj(List<String> res) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Replace with collect" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Test {
|
||||
MyObj test(List<String> list) {
|
||||
List<String> res = new ArrayList<>();
|
||||
for (String s : li<caret>st) {
|
||||
if(!s.isEmpty()) {
|
||||
res.add(s);
|
||||
}
|
||||
}
|
||||
return new MyObj(res);
|
||||
}
|
||||
|
||||
private class MyObj {
|
||||
public MyObj(List<String> res) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user