hg: lambda/lambda/jdk: Streams cleanups; add optimized forEach implementations; include subList in tested lists

Brian Goetz brian.goetz at oracle.com
Sun Nov 18 12:28:39 PST 2012


> A code like this should throw a CME and not an AIOOBE
> arraylist.forEach(e -> { arraylist.remove(e); })

The current code won't do that, as it copies the array into a local var 
before the loop, so the indexes are always valid.

A reasonable middle ground is a comodification check after the loop 
terminates.



More information about the lambda-dev mailing list