JDK-8042355 stream with sorted() causes downstream ops not to be lazy

Paul Sandoz paul.sandoz at oracle.com
Mon May 5 13:16:02 UTC 2014


Hi,

  https://bugs.openjdk.java.net/browse/JDK-8042355
  http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8042355-sorted-short-circuit/webrev/

This is an optimization to ensure that sorted() in sequential pipelines does not aggressively push all sorted elements downstream if the pipeline is known to be short-circuiting.
 
Note that it is not an error that more elements, than strictly required to produce a result, may flow through the pipeline.  This can occur, in general (not restricted to just sorting), for short-circuiting parallel pipelines.

Paul.





More information about the core-libs-dev mailing list