Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8025909 Lambda Library Spec Updates
  3. JDK-8025523

StackOverflowError at java.util.stream.Streams$ConcatSpliterator.estimateSize

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 8
    • 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]);
      }

            psandoz Paul Sandoz
            ogb Oleg Barbashov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: