Non interference enforcement

Joe Bowbeer joe.bowbeer at gmail.com
Wed Sep 26 06:45:15 PDT 2012


Btw, at first glance, this code snippet looked like ListIterator code that
would be allowed.

What about the following?  Is it legal?

listIterator.forEach(e -> { listIterator.remove(e); });


On Wed, Sep 26, 2012 at 6:26 AM, Remi Forax <forax at univ-mlv.fr> wrote:

> We currently ask users to write lambdas that doesn't interfere with the
> source collection
> of a stream but it's not enforced in the code.
>
> By example,
>   list.stream().forEach(e -> { list.remove(e); });
> may works or not depending how the pipeline is implemented.
>
> This is a serous departure for the current way java.util collections works
> and I wonder if we should not keep the fail-fast guarantee for those
> collections.
>
> Rémi
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20120926/6f8fc2b1/attachment.html 


More information about the lambda-libs-spec-experts mailing list