More on no-reuse streams

Paul Sandoz paul.sandoz at oracle.com
Thu Nov 22 02:28:56 PST 2012


I pushed a change set yesterday that adds to the previous constraints:

  Stream s= ...
  s.map();
  s.map(); // throws ISE  

Only linear streams are supported.

Paul.

On Nov 19, 2012, at 3:29 PM, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:

> 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