提交 8241da0e 编写于 作者: P psandoz

8013334: Spliterator behavior for LinkedList contradicts Spliterator.trySplit

Summary: this changeset also contains some minor, non spec, related fixes to tidy up other areas of the JavaDoc.
Reviewed-by: plevart, darcy
Contributed-by: NJohn Rose &lt;john.r.rose@oracle.com&gt;, Mike Duigou &lt;mike.duigou@oracle.com&gt;, Paul Sandoz <paul.sandoz@oracle.com>
上级 200ad4d3
...@@ -140,32 +140,32 @@ import java.util.function.LongConsumer; ...@@ -140,32 +140,32 @@ import java.util.function.LongConsumer;
* (in approximate order of decreasing desirability): * (in approximate order of decreasing desirability):
* <ul> * <ul>
* <li>The source cannot be structurally interfered with. * <li>The source cannot be structurally interfered with.
* </br>For example, an instance of * <br>For example, an instance of
* {@link java.util.concurrent.CopyOnWriteArrayList} is an immutable source. * {@link java.util.concurrent.CopyOnWriteArrayList} is an immutable source.
* A Spliterator created from the source reports a characteristic of * A Spliterator created from the source reports a characteristic of
* {@code IMMUTABLE}.</li> * {@code IMMUTABLE}.</li>
* <li>The source manages concurrent modifications. * <li>The source manages concurrent modifications.
* </br>For example, a key set of a {@link java.util.concurrent.ConcurrentHashMap} * <br>For example, a key set of a {@link java.util.concurrent.ConcurrentHashMap}
* is a concurrent source. A Spliterator created from the source reports a * is a concurrent source. A Spliterator created from the source reports a
* characteristic of {@code CONCURRENT}.</li> * characteristic of {@code CONCURRENT}.</li>
* <li>The mutable source provides a late-binding and fail-fast Spliterator. * <li>The mutable source provides a late-binding and fail-fast Spliterator.
* </br>Late binding narrows the window during which interference can affect * <br>Late binding narrows the window during which interference can affect
* the calculation; fail-fast detects, on a best-effort basis, that structural * the calculation; fail-fast detects, on a best-effort basis, that structural
* interference has occurred after traversal has commenced and throws * interference has occurred after traversal has commenced and throws
* {@link ConcurrentModificationException}. For example, {@link ArrayList}, * {@link ConcurrentModificationException}. For example, {@link ArrayList},
* and many other non-concurrent {@code Collection} classes in the JDK, provide * and many other non-concurrent {@code Collection} classes in the JDK, provide
* a late-binding, fail-fast spliterator.</li> * a late-binding, fail-fast spliterator.</li>
* <li>The mutable source provides a non-late-binding but fail-fast Spliterator. * <li>The mutable source provides a non-late-binding but fail-fast Spliterator.
* </br>The source increases the likelihood of throwing * <br>The source increases the likelihood of throwing
* {@code ConcurrentModificationException} since the window of potential * {@code ConcurrentModificationException} since the window of potential
* interference is larger.</li> * interference is larger.</li>
* <li>The mutable source provides a late-binding and non-fail-fast Spliterator. * <li>The mutable source provides a late-binding and non-fail-fast Spliterator.
* </br>The source risks arbitrary, non-deterministic behavior after traversal * <br>The source risks arbitrary, non-deterministic behavior after traversal
* has commenced since interference is not detected. * has commenced since interference is not detected.
* </li> * </li>
* <li>The mutable source provides a non-late-binding and non-fail-fast * <li>The mutable source provides a non-late-binding and non-fail-fast
* Spliterator. * Spliterator.
* </br>The source increases the risk of arbitrary, non-deterministic behavior * <br>The source increases the risk of arbitrary, non-deterministic behavior
* since non-detected interference may occur after construction. * since non-detected interference may occur after construction.
* </li> * </li>
* </ul> * </ul>
...@@ -284,6 +284,8 @@ import java.util.function.LongConsumer; ...@@ -284,6 +284,8 @@ import java.util.function.LongConsumer;
* is set to {@code true} then diagnostic warnings are reported if boxing of * is set to {@code true} then diagnostic warnings are reported if boxing of
* primitive values occur when operating on primitive subtype specializations. * primitive values occur when operating on primitive subtype specializations.
* *
* @param <T> the type of elements returned by this Spliterator
*
* @see Collection * @see Collection
* @since 1.8 * @since 1.8
*/ */
...@@ -333,9 +335,8 @@ public interface Spliterator<T> { ...@@ -333,9 +335,8 @@ public interface Spliterator<T> {
* Upon non-null return: * Upon non-null return:
* <ul> * <ul>
* <li>the value reported for {@code estimateSize()} before splitting, * <li>the value reported for {@code estimateSize()} before splitting,
* if not already zero or {@code Long.MAX_VALUE}, must, after splitting, be * must, after splitting, be greater than or equal to {@code estimateSize()}
* greater than {@code estimateSize()} for this and the returned * for this and the returned Spliterator; and</li>
* Spliterator; and</li>
* <li>if this Spliterator is {@code SUBSIZED}, then {@code estimateSize()} * <li>if this Spliterator is {@code SUBSIZED}, then {@code estimateSize()}
* for this spliterator before splitting must be equal to the sum of * for this spliterator before splitting must be equal to the sum of
* {@code estimateSize()} for this and the returned Spliterator after * {@code estimateSize()} for this and the returned Spliterator after
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册