mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-161198 Migration from Stream API back to for loops
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class Main {
|
||||
public static int test(List<String> list) {
|
||||
return list.stream().re<caret>duce(0, (a, b) -> a+b.length(), Integer::sum);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(test(asList("a", "b", "c")));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user