8133773: clarify specification of Spliterator.tryAdvance

Reviewed-by: psandoz, tvaleev, rriggs
This commit is contained in:
Viktor Klang 2023-05-09 15:37:23 +00:00 committed by Roger Riggs
parent 5842fd5beb
commit fdbfc8a73b

View File

@ -295,7 +295,7 @@ import java.util.function.LongConsumer;
*/
public interface Spliterator<T> {
/**
* If a remaining element exists, performs the given action on it,
* If a remaining element exists: performs the given action on it,
* returning {@code true}; else returns {@code false}. If this
* Spliterator is {@link #ORDERED} the action is performed on the
* next element in encounter order. Exceptions thrown by the
@ -304,7 +304,7 @@ public interface Spliterator<T> {
* Subsequent behavior of a spliterator is unspecified if the action throws
* an exception.
*
* @param action The action
* @param action The action whose operation is performed at-most once
* @return {@code false} if no remaining elements existed
* upon entry to this method, else {@code true}.
* @throws NullPointerException if the specified action is null