No-reuse streams

Paul Sandoz paul.sandoz at oracle.com
Mon Nov 19 06:29:38 PST 2012


Hi,

Brian and I just pushed a changeset that:

- turns Stream/IntStream.iterator() into a terminal operation

- only one terminal operation may be performed on at most one stream in the pipeline, 
otherwise an ISE will be thrown.

Based on feedback on stream iteration and terminal operation we decided to swing to the other end of the evaluation spectrum.

No laissez-faire attitude to pulling and terminal operations. Streams are now very strict. 

Note that we pulled away from throwing ISEs with regards to infinite streams but in that case we don't think it possible to efficiently detect every scenario that will end up either looping indefinitely or result in a stack overflow or out of memory error.

Paul.


More information about the lambda-dev mailing list