Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8164691

Stream specification clarifications for iterate and collect

XMLWordPrintable

    • b136
    • Not verified

      1) The 3 arg Stream.iterate should clarify that the "hasNext" and "next" functions may be called in an arbitrary thread but are serially thread confined (similar in nature to the function passed to forEachOrdered)

      2) The 3 arg version of Stream.collect:

      <R> R collect(Supplier<R> supplier,
                        BiConsumer<R, ? super T> accumulator,
                        BiConsumer<R, R> combiner);

      should specify for the combiner that the value of the second argument is combined into the first (see http://stackoverflow.com/questions/30309127/why-is-the-combiner-of-the-collector-interface-not-consistent-with-the-overloade/30309439#30309439)

            psandoz Paul Sandoz
            psandoz Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: