RFR: 8005051: optimized defaults for Iterator.forEachRemaining

Akhil Arora akhil.arora at oracle.com
Fri Apr 19 16:59:59 PDT 2013

Please review the addition of optimized defaults for Iterator's 
forEachRemaining to ArrayList, LinkedList, Vector and 
CopyOnWriteArrayList. The unit test has a performance comparison test 
(disabled by default) that measures the difference between this method 
and hasNext()/next(). Significant improvements were measured by 
overriding the default forEachRemaining by these classes (others, not so 



More information about the lambda-dev mailing list