RFR: 8005051: default methods for Iterator (original) (raw)
Akhil Arora akhil.arora at oracle.com
Fri Dec 14 01:24:35 UTC 2012
- Previous message: [PATCH] Sunbug 7131192: Optimize BigInteger.doubleValue(), floatValue()
- Next message: RFR: 8005051: default methods for Iterator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
As part of the library lambdafication, this patch adds a forEach default method to Iterator, and converts remove() into a default method so that implementations of Iterator no longer have to override remove if they desire the default behavior, which is to throw an UnsupportedOperationException.
http://cr.openjdk.java.net/~akhil/8005051.0/webrev/
The above patch requires a small patch to an internal class which happens to implement both Iterable and Iterator. Now both Iterable and Iterator supply a default forEach method, so the compiler balks. One minimally intrusive solution is for this class to override both defaults and provide its own version of forEach.
http://cr.openjdk.java.net/~akhil/8005053.0/webrev/
Please review Thanks
- Previous message: [PATCH] Sunbug 7131192: Optimize BigInteger.doubleValue(), floatValue()
- Next message: RFR: 8005051: default methods for Iterator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]