RFR 8168745 Iterator.forEachRemaining vs. Iterator.remove (original) (raw)

Paul Sandoz paul.sandoz at oracle.com
Wed Nov 23 18:43:48 UTC 2016


Stuart and I refined the text to mention a concurrent modification policy (e.g. fail-fast or weakly consistent) of any overriding class.

Paul.

diff -r c7b932897909 src/java.base/share/classes/java/lang/Iterable.java --- a/src/java.base/share/classes/java/lang/Iterable.java Wed Nov 23 10:35:44 2016 -0800 +++ b/src/java.base/share/classes/java/lang/Iterable.java Wed Nov 23 10:40:53 2016 -0800 @@ -53,10 +53,13 @@ /** * Performs the given action for each element of the {@code Iterable} * until all elements have been processed or the action throws an

diff -r c7b932897909 src/java.base/share/classes/java/util/Iterator.java --- a/src/java.base/share/classes/java/util/Iterator.java Wed Nov 23 10:35:44 2016 -0800 +++ b/src/java.base/share/classes/java/util/Iterator.java Wed Nov 23 10:40:53 2016 -0800 @@ -76,10 +76,15 @@ /** * Removes from the underlying collection the last element returned * by this iterator (optional operation). This method can be called

@@ -102,6 +107,13 @@ * have been processed or the action throws an exception. Actions are * performed in the order of iteration, if that order is specified. * Exceptions thrown by the action are relayed to the caller.



More information about the core-libs-dev mailing list