mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
IDEA-161198 Migration from Stream API back to for loops
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.IntSummaryStatistics;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Main {
|
||||
public static IntSummaryStatistics test() {
|
||||
IntSummaryStatistics stat = new IntSummaryStatistics();
|
||||
long limit = 20;
|
||||
for (String x = ""; ; x = x + "a") {
|
||||
if (limit-- == 0) break;
|
||||
int i = x.length();
|
||||
stat.accept(i);
|
||||
}
|
||||
return stat;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(test());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user