RFR(s): 8166446 SingletonIterator.forEachRemaining doesn't advance before calling action
martinrb at google.com
Tue Dec 6 21:48:42 UTC 2016
I've called similar methods assertIteratorExhausted instead of checkAtEnd.
You could add
it.forEachRemaining(e -> throw new AssertionError());
to that method.
On Tue, Dec 6, 2016 at 1:28 PM, Stuart Marks <stuart.marks at oracle.com>
> Hi all,
> Please review this small fix to adjust the behavior of
> SingletonIterator.forEachRemaining in the case where its action throws an
> Strictly speaking, this behavior is undefined (see the spec adjustment
> JDK-8168745   that Paul Sandoz pushed recently). However, we felt it
> was reasonable to make this case behave consistently with the default
> implementation of Iterator.forEachRemaining(), which advances before
> calling the action.
> Also, please ignore the extra changeset comment lines in the webrev.
> There's only one changeset here:
> rev 16204 : 8166446: SingletonIterator.forEachRemaining doesn't
> advance before calling action
> Something funny is up with webrev....
>  https://bugs.openjdk.java.net/browse/JDK-8168745
>  http://hg.openjdk.java.net/jdk9/dev/jdk/rev/a563aaa85446
More information about the core-libs-dev