RFR: 8005051: default methods for Iterator

Paul Sandoz paul.sandoz at oracle.com
Fri Dec 14 13:00:43 UTC 2012

On Dec 14, 2012, at 11:54 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> We can't remove Collection.forEach without having perf issue because the stream pipeline use it.
> Iterator.forEach can be removed but it's a pity because it's really convenient,

And a case can be made performance wise too (there are optimal implementations in the stream code base). 

I have found that forEach, in general, has been very useful. Since it abstracts away the details of traversal it has enabled better re-use of code.


> a possble solution is to rename Iterator.forEach() to something else.
>> Please review
>> Thanks
> cheers,
> Rémi

More information about the core-libs-dev mailing list