-
Type:
Sub-task
-
Resolution: Won't Fix
-
Priority:
P4
-
Affects Version/s: 8
-
Component/s: core-libs
Consecutive concatenation of streams may leads to stack overflow due to recursive invocation of estimateSize():
int count = 20000;
IntStream s[] = new IntStream[count];
for (int i = 0; i < count; i++) {
s[i] = Arrays.stream(new int[1]);
}
IntStream cs = s[0];
for (int i = 1; i < count; i++) {
cs = IntStream.concat(cs, s[i]);
}
int count = 20000;
IntStream s[] = new IntStream[count];
for (int i = 0; i < count; i++) {
s[i] = Arrays.stream(new int[1]);
}
IntStream cs = s[0];
for (int i = 1; i < count; i++) {
cs = IntStream.concat(cs, s[i]);
}