changeset 8361:2412b92bfde3

javadoc corrections.
author mduigou
date Tue, 23 Apr 2013 19:34:32 -0700
parents 17f3af761c70
children e0868a1de269
files src/share/classes/java/util/Spliterator.java src/share/classes/java/util/stream/DistinctOps.java src/share/classes/java/util/stream/DoublePipeline.java src/share/classes/java/util/stream/IntPipeline.java src/share/classes/java/util/stream/LongPipeline.java src/share/classes/java/util/stream/Nodes.java src/share/classes/java/util/stream/ReduceOps.java src/share/classes/java/util/stream/ReferencePipeline.java src/share/classes/java/util/stream/SliceOps.java src/share/classes/java/util/stream/SortedOps.java src/share/classes/java/util/stream/SpinedBuffer.java src/share/classes/java/util/stream/StreamSpliterators.java src/share/classes/java/util/stream/StreamSupport.java
diffstat 13 files changed, 414 insertions(+), 303 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/Spliterator.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/Spliterator.java	Tue Apr 23 19:34:32 2013 -0700
@@ -284,6 +284,8 @@
  * is set to {@code true} then diagnostic warnings are reported if boxing of
  * primitive values occur when operating on primitive subtype specializations.
  *
+ * @param <T> the type of elements returned by this Spliterator
+ * 
  * @see Collection
  * @since 1.8
  */
--- a/src/share/classes/java/util/stream/DistinctOps.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/DistinctOps.java	Tue Apr 23 19:34:32 2013 -0700
@@ -47,8 +47,8 @@
      * Appends a "distinct" operation to the provided stream, and returns the
      * new stream.
      *
-     * @param <T> The type of both input and output elements
-     * @param upstream A reference stream with element type T
+     * @param <T> the type of both input and output elements
+     * @param upstream a reference stream with element type T
      * @return the new stream
      */
     static<T> ReferencePipeline<T, T> makeRef(AbstractPipeline<?, T, ?> upstream) {
@@ -100,8 +100,7 @@
 
                 if (StreamOpFlag.DISTINCT.isKnown(flags)) {
                     return sink;
-                }
-                else if (StreamOpFlag.SORTED.isKnown(flags)) {
+                } else if (StreamOpFlag.SORTED.isKnown(flags)) {
                     return new Sink.ChainedReference<T>(sink) {
                         boolean seenNull;
                         T lastSeen;
@@ -132,8 +131,7 @@
                             }
                         }
                     };
-                }
-                else {
+                } else {
                     return new Sink.ChainedReference<T>(sink) {
                         Set<T> seen;
 
--- a/src/share/classes/java/util/stream/DoublePipeline.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/DoublePipeline.java	Tue Apr 23 19:34:32 2013 -0700
@@ -46,7 +46,9 @@
 /**
  * Abstract base class for an intermediate pipeline stage or pipeline source
  * stage implementing whose elements are of type {@code double}.
- * @param <E_IN> Type of elements in the upstream source.
+ *
+ * @param <E_IN> type of elements in the upstream source
+ *
  * @since 1.8
  */
 abstract class DoublePipeline<E_IN>
@@ -57,7 +59,7 @@
      * Constructor for the head of a stream pipeline.
      *
      * @param source {@code Supplier<Spliterator>} describing the stream source
-     * @param sourceFlags The source flags for the stream source, described in
+     * @param sourceFlags the source flags for the stream source, described in
      * {@link StreamOpFlag}
      */
     DoublePipeline(Supplier<? extends Spliterator<Double>> source,
@@ -69,7 +71,7 @@
      * Constructor for the head of a stream pipeline.
      *
      * @param source {@code Spliterator} describing the stream source
-     * @param sourceFlags The source flags for the stream source, described in
+     * @param sourceFlags the source flags for the stream source, described in
      * {@link StreamOpFlag}
      */
     DoublePipeline(Spliterator<Double> source,
@@ -78,7 +80,8 @@
     }
 
     /**
-     * Constructor for appending an intermediate operation onto an existing pipeline.
+     * Constructor for appending an intermediate operation onto an existing
+     * pipeline.
      *
      * @param upstream the upstream element source.
      * @param opFlags the operation flags
@@ -89,13 +92,12 @@
 
     /**
      * Adapt a {@code Sink<Double> to a {@code DoubleConsumer}, ideally simply
-     * by casting
+     * by casting.
      */
     private static DoubleConsumer adapt(Sink<Double> sink) {
         if (sink instanceof DoubleConsumer) {
             return (DoubleConsumer) sink;
-        }
-        else {
+        } else {
             if (Tripwire.ENABLED)
                 Tripwire.trip(AbstractPipeline.class,
                               "using DoubleStream.adapt(Sink<Double> s)");
@@ -107,14 +109,13 @@
      * Adapt a {@code Spliterator<Double>} to a {@code Spliterator.OfDouble}.
      *
      * @implNote
-     * The implementation attempts to cast to a Spliterator.OfDouble, and throws an
-     * exception if this cast is not possible.
+     * The implementation attempts to cast to a Spliterator.OfDouble, and throws
+     * an exception if this cast is not possible.
      */
     private static Spliterator.OfDouble adapt(Spliterator<Double> s) {
         if (s instanceof Spliterator.OfDouble) {
             return (Spliterator.OfDouble) s;
-        }
-        else {
+        } else {
             if (Tripwire.ENABLED)
                 Tripwire.trip(AbstractPipeline.class,
                               "using DoubleStream.adapt(Spliterator<Double> s)");
@@ -465,16 +466,20 @@
 
     //
 
-    /** Source stage of a DoubleStream */
+    /**
+     * Source stage of a DoubleStream
+     *
+     * @param <E_IN> type of elements in the upstream source
+     */
     static class Head<E_IN> extends DoublePipeline<E_IN> {
         /**
          * Constructor for the source stage of a DoubleStream.
          *
          * @param source {@code Supplier<Spliterator>} describing the stream
          *               source
-         * @param sourceFlags The source flags for the stream source, described
+         * @param sourceFlags the source flags for the stream source, described
          *                    in {@link StreamOpFlag}
-         * @param parallel True if the pipeline is parallel
+         * @param parallel {@code true} if the pipeline is parallel
          */
         Head(Supplier<? extends Spliterator<Double>> source,
              int sourceFlags, boolean parallel) {
@@ -485,9 +490,9 @@
          * Constructor for the source stage of a DoubleStream.
          *
          * @param source {@code Spliterator} describing the stream source
-         * @param sourceFlags The source flags for the stream source, described
+         * @param sourceFlags the source flags for the stream source, described
          *                    in {@link StreamOpFlag}
-         * @param parallel True if the pipeline is parallel
+         * @param parallel {@code true} if the pipeline is parallel
          */
         Head(Spliterator<Double> source,
              int sourceFlags, boolean parallel) {
@@ -528,14 +533,20 @@
 
     }
 
-    /** Base class for a stateless intermediate stage of a DoubleStream */
+    /**
+     * Base class for a stateless intermediate stage of a DoubleStream.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @since 1.8
+     */
     abstract static class StatelessOp<E_IN> extends DoublePipeline<E_IN> {
         /**
          * Construct a new DoubleStream by appending a stateless intermediate
          * operation to an existing stream.
-         * @param upstream The upstream pipeline stage
-         * @param inputShape The stream shape for the upstream pipeline stage
-         * @param opFlags Operation flags for the new stage
+         *
+         * @param upstream the upstream pipeline stage
+         * @param inputShape the stream shape for the upstream pipeline stage
+         * @param opFlags operation flags for the new stage
          */
         StatelessOp(AbstractPipeline<?, E_IN, ?> upstream,
                     StreamShape inputShape,
@@ -550,14 +561,20 @@
         }
     }
 
-    /** Base class for a stateful intermediate stage of a DoubleStream */
+    /**
+     * Base class for a stateful intermediate stage of a DoubleStream.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @since 1.8
+     */
     abstract static class StatefulOp<E_IN> extends DoublePipeline<E_IN> {
         /**
          * Construct a new DoubleStream by appending a stateful intermediate
          * operation to an existing stream.
-         * @param upstream The upstream pipeline stage
-         * @param inputShape The stream shape for the upstream pipeline stage
-         * @param opFlags Operation flags for the new stage
+         *
+         * @param upstream the upstream pipeline stage
+         * @param inputShape the stream shape for the upstream pipeline stage
+         * @param opFlags operation flags for the new stage
          */
         StatefulOp(AbstractPipeline<?, E_IN, ?> upstream,
                    StreamShape inputShape,
--- a/src/share/classes/java/util/stream/IntPipeline.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/IntPipeline.java	Tue Apr 23 19:34:32 2013 -0700
@@ -46,7 +46,8 @@
 /**
  * Abstract base class for an intermediate pipeline stage or pipeline source
  * stage implementing whose elements are of type {@code int}.
- * @param <E_IN> Type of elements in the upstream source.
+ *
+ * @param <E_IN> type of elements in the upstream source
  * @since 1.8
  */
 abstract class IntPipeline<E_IN>
@@ -59,7 +60,7 @@
      * @param source {@code Supplier<Spliterator>} describing the stream source
      * @param sourceFlags The source flags for the stream source, described in
      *        {@link StreamOpFlag}
-     * @param parallel True if the pipeline is parallel
+     * @param parallel {@code true} if the pipeline is parallel
      */
     IntPipeline(Supplier<? extends Spliterator<Integer>> source,
                 int sourceFlags, boolean parallel) {
@@ -72,7 +73,7 @@
      * @param source {@code Spliterator} describing the stream source
      * @param sourceFlags The source flags for the stream source, described in
      *        {@link StreamOpFlag}
-     * @param parallel True if the pipeline is parallel
+     * @param parallel {@code true} if the pipeline is parallel
      */
     IntPipeline(Spliterator<Integer> source,
                 int sourceFlags, boolean parallel) {
@@ -92,7 +93,7 @@
 
     /**
      * Adapt a {@code Sink<Integer> to an {@code IntConsumer}, ideally simply
-     * by casting
+     * by casting.
      */
     private static IntConsumer adapt(Sink<Integer> sink) {
         if (sink instanceof IntConsumer) {
@@ -500,19 +501,23 @@
                         .asIntArray();
     }
 
-
     //
 
-    /** Source stage of an IntStream */
+    /**
+     * Source stage of an IntStream.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @since 1.8
+     */
     static class Head<E_IN> extends IntPipeline<E_IN> {
         /**
          * Constructor for the source stage of an IntStream.
          *
          * @param source {@code Supplier<Spliterator>} describing the stream
          *               source
-         * @param sourceFlags The source flags for the stream source, described
+         * @param sourceFlags the source flags for the stream source, described
          *                    in {@link StreamOpFlag}
-         * @param parallel True if the pipeline is parallel
+         * @param parallel {@code true} if the pipeline is parallel
          */
         Head(Supplier<? extends Spliterator<Integer>> source,
              int sourceFlags, boolean parallel) {
@@ -523,9 +528,9 @@
          * Constructor for the source stage of an IntStream.
          *
          * @param source {@code Spliterator} describing the stream source
-         * @param sourceFlags The source flags for the stream source, described
+         * @param sourceFlags the source flags for the stream source, described
          *                    in {@link StreamOpFlag}
-         * @param parallel True if the pipeline is parallel
+         * @param parallel {@code true} if the pipeline is parallel
          */
         Head(Spliterator<Integer> source,
              int sourceFlags, boolean parallel) {
@@ -565,7 +570,12 @@
         }
     }
 
-    /** Base class for a stateless intermediate stage of an IntStream */
+    /**
+     * Base class for a stateless intermediate stage of an IntStream
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @since 1.8
+     */
     abstract static class StatelessOp<E_IN> extends IntPipeline<E_IN> {
         /**
          * Construct a new IntStream by appending a stateless intermediate
@@ -587,7 +597,12 @@
         }
     }
 
-    /** Base class for a stateful intermediate stage of an IntStream */
+    /**
+     * Base class for a stateful intermediate stage of an IntStream.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @since 1.8
+     */
     abstract static class StatefulOp<E_IN> extends IntPipeline<E_IN> {
         /**
          * Construct a new IntStream by appending a stateful intermediate
--- a/src/share/classes/java/util/stream/LongPipeline.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/LongPipeline.java	Tue Apr 23 19:34:32 2013 -0700
@@ -47,7 +47,8 @@
 /**
  * Abstract base class for an intermediate pipeline stage or pipeline source
  * stage implementing whose elements are of type {@code long}.
- * @param <E_IN> Type of elements in the upstream source.
+ *
+ * @param <E_IN> type of elements in the upstream source
  * @since 1.8
  */
 abstract class LongPipeline<E_IN>
@@ -58,9 +59,9 @@
      * Constructor for the head of a stream pipeline.
      *
      * @param source {@code Supplier<Spliterator>} describing the stream source
-     * @param sourceFlags The source flags for the stream source, described in
+     * @param sourceFlags the source flags for the stream source, described in
      *        {@link StreamOpFlag}
-     * @param parallel True if the pipeline is parallel
+     * @param parallel {@code true} if the pipeline is parallel
      */
     LongPipeline(Supplier<? extends Spliterator<Long>> source,
                  int sourceFlags, boolean parallel) {
@@ -71,9 +72,9 @@
      * Constructor for the head of a stream pipeline.
      *
      * @param source {@code Spliterator} describing the stream source
-     * @param sourceFlags The source flags for the stream source, described in
+     * @param sourceFlags the source flags for the stream source, described in
      *        {@link StreamOpFlag}
-     * @param parallel True if the pipeline is parallel
+     * @param parallel {@code true} if the pipeline is parallel
      */
     LongPipeline(Spliterator<Long> source,
                  int sourceFlags, boolean parallel) {
@@ -92,13 +93,12 @@
 
     /**
      * Adapt a {@code Sink<Long> to an {@code LongConsumer}, ideally simply
-     * by casting
+     * by casting.
      */
     private static LongConsumer adapt(Sink<Long> sink) {
         if (sink instanceof LongConsumer) {
             return (LongConsumer) sink;
-        }
-        else {
+        } else {
             if (Tripwire.ENABLED)
                 Tripwire.trip(AbstractPipeline.class,
                               "using LongStream.adapt(Sink<Long> s)");
@@ -110,14 +110,13 @@
      * Adapt a {@code Spliterator<Long>} to a {@code Spliterator.OfLong}.
      *
      * @implNote
-     * The implementation attempts to cast to a Spliterator.OfLong, and throws an
-     * exception if this cast is not possible.
+     * The implementation attempts to cast to a Spliterator.OfLong, and throws
+     * an exception if this cast is not possible.
      */
     private static Spliterator.OfLong adapt(Spliterator<Long> s) {
         if (s instanceof Spliterator.OfLong) {
             return (Spliterator.OfLong) s;
-        }
-        else {
+        } else {
             if (Tripwire.ENABLED)
                 Tripwire.trip(AbstractPipeline.class,
                               "using LongStream.adapt(Spliterator<Long> s)");
@@ -486,16 +485,21 @@
 
     //
 
-    /** Source stage of a LongPipeline */
+    /**
+     * Source stage of a LongPipeline.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @since 1.8
+     */
     static class Head<E_IN> extends LongPipeline<E_IN> {
         /**
          * Constructor for the source stage of a LongStream.
          *
          * @param source {@code Supplier<Spliterator>} describing the stream
          *               source
-         * @param sourceFlags The source flags for the stream source, described
+         * @param sourceFlags the source flags for the stream source, described
          *                    in {@link StreamOpFlag}
-         * @param parallel True if the pipeline is parallel
+         * @param parallel {@code true} if the pipeline is parallel
          */
         Head(Supplier<? extends Spliterator<Long>> source,
              int sourceFlags, boolean parallel) {
@@ -506,9 +510,9 @@
          * Constructor for the source stage of a LongStream.
          *
          * @param source {@code Spliterator} describing the stream source
-         * @param sourceFlags The source flags for the stream source, described
+         * @param sourceFlags the source flags for the stream source, described
          *                    in {@link StreamOpFlag}
-         * @param parallel True if the pipeline is parallel
+         * @param parallel {@code true} if the pipeline is parallel
          */
         Head(Spliterator<Long> source,
              int sourceFlags, boolean parallel) {
@@ -531,8 +535,7 @@
         public void forEach(LongConsumer action) {
             if (!isParallel()) {
                 adapt(sourceStageSpliterator()).forEachRemaining(action);
-            }
-            else {
+            } else {
                 super.forEach(action);
             }
         }
@@ -541,14 +544,17 @@
         public void forEachOrdered(LongConsumer action) {
             if (!isParallel()) {
                 adapt(sourceStageSpliterator()).forEachRemaining(action);
-            }
-            else {
+            } else {
                 super.forEachOrdered(action);
             }
         }
     }
 
-    /** Base class for a stateless intermediate stage of a LongStream */
+    /** Base class for a stateless intermediate stage of a LongStream.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @since 1.8
+     */
     abstract static class StatelessOp<E_IN> extends LongPipeline<E_IN> {
         /**
          * Construct a new LongStream by appending a stateless intermediate
@@ -570,7 +576,12 @@
         }
     }
 
-    /** Base class for a stateful intermediate stage of a LongStream */
+    /**
+     * Base class for a stateful intermediate stage of a LongStream.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @since 1.8
+     */
     abstract static class StatefulOp<E_IN> extends LongPipeline<E_IN> {
         /**
          * Construct a new LongStream by appending a stateful intermediate
--- a/src/share/classes/java/util/stream/Nodes.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/Nodes.java	Tue Apr 23 19:34:32 2013 -0700
@@ -68,8 +68,8 @@
     /**
      * Produces an empty node whose count is zero, has no children and no content.
      *
-     * @param shape the shape of the node to be created.
-     * @param <T> the type of elements of the created node.
+     * @param <T> the type of elements of the created node
+     * @param shape the shape of the node to be created
      * @return an empty node.
      */
     @SuppressWarnings("unchecked")
@@ -95,9 +95,9 @@
      * <p>The result may be a concatenated node, the input sole node if the size
      * of the list is 1, or an empty node.
      *
+     * @param <T> the type of elements of the concatenated node
      * @param shape the shape of the concatenated node to be created
      * @param nodes the input nodes
-     * @param <T> the type of elements of the concatenated node
      * @return a {@code Node} covering the elements of the input nodes
      * @throws IllegalStateException if all {@link Node} elements of the list
      * are an not instance of type supported by this factory.
@@ -155,11 +155,11 @@
      * Truncate a {@link Node}, returning a node describing a subsequence of
      * the contents of the input node.
      *
+     * @param <T> the type of elements of the input node and truncated node
      * @param input the input node
      * @param from the starting offset to include in the truncated node (inclusive)
      * @param to the ending offset ot include in the truncated node (exclusive)
      * @param generator the array factory (only used for reference nodes)
-     * @param <T> the type of elements of the input node and truncated node
      * @return the truncated node
      */
     @SuppressWarnings("unchecked")
@@ -226,11 +226,11 @@
 
     /**
      * Produces a {@link Node} describing an array.
-     * <p>
-     * The node will hold a reference to the array and will not make a copy.
      *
-     * @param array the array.
+     * <p>The node will hold a reference to the array and will not make a copy.
+     *
      * @param <T> the type of elements held by the node
+     * @param array the array
      * @return a node holding an array
      */
     static<T> Node<T> node(T[] array) {
@@ -242,9 +242,9 @@
      * <p>
      * The node will hold a reference to the collection and will not make a copy.
      *
-     * @param c the collection.
-     * @param <T> the type of elements held by the node.
-     * @return a node holding a collection.
+     * @param <T> the type of elements held by the node
+     * @param c the collection
+     * @return a node holding a collection
      */
     static<T> Node<T> node(Collection<T> c) {
         return new CollectionNode<>(c);
@@ -280,8 +280,8 @@
 
     /**
      * Produces a {@link Node.OfInt} describing an int[] array.
-     * <p>
-     * The node will hold a reference to the array and will not make a copy.
+     *
+     * <p>The node will hold a reference to the array and will not make a copy.
      *
      * @param array the array
      * @return a node holding an array
@@ -354,8 +354,8 @@
 
     /**
      * Produces a {@link Node.OfDouble} describing a double[] array.
-     * <p>
-     * The node will hold a reference to the array and will not make a copy.
+     *
+     * <p>The node will hold a reference to the array and will not make a copy.
      *
      * @param array the array
      * @return a node holding an array
@@ -442,6 +442,7 @@
      * of the computation. This conc-node can then be flattened in
      * parallel to produce a flat {@code Node.OfInt} if desired.
      *
+     * @param <P_IN> the type of elements from the source Spliterator
      * @param helper the pipeline helper describing the pipeline
      * @param flattenTree whether a conc node should be flattened into a node
      *                    describing an array before returning
@@ -479,6 +480,7 @@
      * of the computation. This conc-node can then be flattened in
      * parallel to produce a flat {@code Node.OfLong} if desired.
      *
+     * @param <P_IN> the type of elements from the source Spliterator
      * @param helper the pipeline helper describing the pipeline
      * @param flattenTree whether a conc node should be flattened into a node
      *                    describing an array before returning
@@ -516,6 +518,7 @@
      * of the computation. This conc-node can then be flattened in
      * parallel to produce a flat {@code Node.OfDouble} if desired.
      *
+     * @param <P_IN> the type of elements from the source Spliterator
      * @param helper the pipeline helper describing the pipeline
      * @param flattenTree whether a conc node should be flattened into a node
      *                    describing an array before returning
@@ -550,9 +553,9 @@
      * and leaf node elements are placed in the array concurrently by leaf tasks
      * at the correct offsets.
      *
+     * @param <T> type of elements contained by the node
      * @param node the node to flatten
      * @param generator the array factory used to create array instances
-     * @param <T> type of elements contained by the node
      * @return a flat {@code Node}
      */
     public static <T> Node<T> flatten(Node<T> node, IntFunction<T[]> generator) {
@@ -823,7 +826,9 @@
         }
     }
 
-    /** Node class for an internal node with two or more children */
+    /**
+     * Node class for an internal node with two or more children
+     */
     static final class ConcNode<T> implements Node<T> {
         private final Node<T> left;
         private final Node<T> right;
@@ -1204,7 +1209,9 @@
         }
     }
 
-    /** Fixed-sized builder class for reference nodes */
+    /**
+     * Fixed-sized builder class for reference nodes
+     */
     private static final class FixedNodeBuilder<T>
             extends ArrayNode<T>
             implements Node.Builder<T> {
@@ -1254,7 +1261,9 @@
         }
     }
 
-    /** Variable-sized builder class for reference nodes */
+    /**
+     * Variable-sized builder class for reference nodes
+     */
     private static final class SpinedNodeBuilder<T>
             extends SpinedBuffer<T>
             implements Node<T>, Node.Builder<T> {
--- a/src/share/classes/java/util/stream/ReduceOps.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/ReduceOps.java	Tue Apr 23 19:34:32 2013 -0700
@@ -54,18 +54,18 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a functional reduce on
-     * reference values
+     * reference values.
      *
-     * @param seed The identity element for the reduction
-     * @param reducer The accumulating function that incorporates an additional
+     * @param <T> the type of the input elements
+     * @param <U> the type of the result
+     * @param seed the identity element for the reduction
+     * @param reducer the accumulating function that incorporates an additional
      *        input element into the result
-     * @param combiner The combining function that combines two intermediate
+     * @param combiner the combining function that combines two intermediate
      *        results
-     * @param <T> The type of the input elements
-     * @param <U> The type of the result
-     * @return A {@code TerminalOp} implementing the reduction
+     * @return a {@code TerminalOp} implementing the reduction
      */
-    public static<T, U> TerminalOp<T, U>
+    public static <T, U> TerminalOp<T, U>
     makeRef(U seed, BiFunction<U, ? super T, U> reducer, BinaryOperator<U> combiner) {
         Objects.requireNonNull(reducer);
         Objects.requireNonNull(combiner);
@@ -95,10 +95,10 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a functional reduce on
-     * reference values producing an optional reference result
+     * reference values producing an optional reference result.
      *
+     * @param <T> The type of the input elements, and the type of the result
      * @param operator The reducing function
-     * @param <T> The type of the input elements, and the type of the result
      * @return A {@code TerminalOp} implementing the reduction
      */
     public static<T> TerminalOp<T, Optional<T>>
@@ -145,12 +145,12 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a mutable reduce on
-     * reference values
+     * reference values.
      *
-     * @param collector A {@code Collector} defining the reduction
-     * @param <T> The type of the input elements
-     * @param <R> The type of the result
-     * @return A {@code ReduceOp} implementing the reduction
+     * @param <T> the type of the input elements
+     * @param <R> the type of the result
+     * @param collector a {@code Collector} defining the reduction
+     * @return a {@code ReduceOp} implementing the reduction
      */
     public static<T,R> TerminalOp<T, R>
     makeRef(Collector<? super T,R> collector) {
@@ -193,15 +193,15 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a mutable reduce on
-     * reference values
+     * reference values.
      *
-     * @param seedFactory A factory to produce a new base accumulator
-     * @param accumulator A function to incorporate an element into an
+     * @param <T> the type of the input elements
+     * @param <R> the type of the result
+     * @param seedFactory a factory to produce a new base accumulator
+     * @param accumulator a function to incorporate an element into an
      *        accumulator
-     * @param reducer A function to combine an accumulator into another
-     * @param <T> The type of the input elements
-     * @param <R> The type of the result
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param reducer a function to combine an accumulator into another
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static<T, R> TerminalOp<T, R>
     makeRef(Supplier<R> seedFactory,
@@ -237,11 +237,11 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a functional reduce on
-     * {@code int} values
+     * {@code int} values.
      *
-     * @param identity The identity for the combining function
-     * @param operator The combining function
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param identity the identity for the combining function
+     * @param operator the combining function
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static TerminalOp<Integer, Integer>
     makeInt(int identity, IntBinaryOperator operator) {
@@ -280,10 +280,10 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a functional reduce on
-     * {@code int} values, producing an optional integer result
+     * {@code int} values, producing an optional integer result.
      *
-     * @param operator The combining function
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param operator the combining function
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static TerminalOp<Integer, OptionalInt>
     makeInt(IntBinaryOperator operator) {
@@ -330,12 +330,13 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a mutable reduce on
-     * {@code int} values
+     * {@code int} values.
      *
-     * @param supplier
-     * @param accumulator
-     * @param combiner
      * @param <R> The type of the result
+     * @param supplier a factory to produce a new accumulator of the result type
+     * @param accumulator a function to incorporate an int into an
+     *        accumulator
+     * @param combiner a function to combine an accumulator into another
      * @return A {@code ReduceOp} implementing the reduction
      */
     public static <R> TerminalOp<Integer, R>
@@ -372,11 +373,11 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a functional reduce on
-     * {@code long} values
+     * {@code long} values.
      *
-     * @param identity The identity for the combining function
-     * @param operator The combining function
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param identity the identity for the combining function
+     * @param operator the combining function
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static TerminalOp<Long, Long>
     makeLong(long identity, LongBinaryOperator operator) {
@@ -415,10 +416,10 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a functional reduce on
-     * {@code long} values, producing an optional long result
+     * {@code long} values, producing an optional long result.
      *
-     * @param operator The combining function
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param operator the combining function
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static TerminalOp<Long, OptionalLong>
     makeLong(LongBinaryOperator operator) {
@@ -465,13 +466,14 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a mutable reduce on
-     * {@code long} values
+     * {@code long} values.
      *
-     * @param supplier
-     * @param accumulator
-     * @param combiner
-     * @param <R> The type of the result
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param <R> the type of the result
+     * @param supplier a factory to produce a new accumulator of the result type
+     * @param accumulator a function to incorporate an int into an
+     *        accumulator
+     * @param combiner a function to combine an accumulator into another
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static <R> TerminalOp<Long, R>
     makeLong(Supplier<R> supplier,
@@ -507,11 +509,11 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a functional reduce on
-     * {@code double} values
+     * {@code double} values.
      *
-     * @param identity The identity for the combining function
-     * @param operator The combining function
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param identity the identity for the combining function
+     * @param operator the combining function
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static TerminalOp<Double, Double>
     makeDouble(double identity, DoubleBinaryOperator operator) {
@@ -550,10 +552,10 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a functional reduce on
-     * {@code double} values, producing an optional double result
+     * {@code double} values, producing an optional double result.
      *
-     * @param operator The combining function
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param operator the combining function
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static TerminalOp<Double, OptionalDouble>
     makeDouble(DoubleBinaryOperator operator) {
@@ -600,13 +602,14 @@
 
     /**
      * Constructs a {@code TerminalOp} that implements a mutable reduce on
-     * {@code double} values
+     * {@code double} values.
      *
-     * @param supplier
-     * @param accumulator
-     * @param combiner
-     * @param <R> The type of the result
-     * @return A {@code TerminalOp} implementing the reduction
+     * @param <R> the type of the result
+     * @param supplier a factory to produce a new accumulator of the result type
+     * @param accumulator a function to incorporate an int into an
+     *        accumulator
+     * @param combiner a function to combine an accumulator into another
+     * @return a {@code TerminalOp} implementing the reduction
      */
     public static <R> TerminalOp<Double, R>
     makeDouble(Supplier<R> supplier,
@@ -645,9 +648,9 @@
      * operation on elements of type {@code T} and producing a result of type
      * {@code R}.
      *
-     * @param <T> The type of input element to the combining operation
-     * @param <R> The result type
-     * @param <K> The type of the {@code AccumulatingSink}.
+     * @param <T> the type of input element to the combining operation
+     * @param <R> the result type
+     * @param <K> the type of the {@code AccumulatingSink}.
      */
     private interface AccumulatingSink<T, R, K extends AccumulatingSink<T, R, K>>
             extends TerminalSink<T, R> {
@@ -676,9 +679,9 @@
      * operation. The {@code AccumulatingSink} must represent an associative
      * reducing operation.
      *
-     * @param <T> The output type of the stream pipeline
-     * @param <R> The result type of the reducing operation
-     * @param <S> The type of the {@code AccumulatingSink}
+     * @param <T> the output type of the stream pipeline
+     * @param <R> the result type of the reducing operation
+     * @param <S> the type of the {@code AccumulatingSink}
      */
     private static abstract class ReduceOp<T, R, S extends AccumulatingSink<T, R, S>>
             implements TerminalOp<T, R> {
@@ -686,7 +689,7 @@
 
         /**
          * Create a {@code ReduceOp} of the specified stream shape which uses
-         * the specified {@code Supplier} to create accumulating sinks
+         * the specified {@code Supplier} to create accumulating sinks.
          *
          * @param shape The shape of the stream pipeline
          */
@@ -714,7 +717,9 @@
         }
     }
 
-    /** A {@code ForkJoinTask} for performing a parallel reduce operation */
+    /**
+     * A {@code ForkJoinTask} for performing a parallel reduce operation.
+     */
     private static final class ReduceTask<P_IN, P_OUT, R,
                                           S extends AccumulatingSink<P_OUT, R, S>>
             extends AbstractTask<P_IN, P_OUT, S, ReduceTask<P_IN, P_OUT, R, S>> {
--- a/src/share/classes/java/util/stream/ReferencePipeline.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/ReferencePipeline.java	Tue Apr 23 19:34:32 2013 -0700
@@ -50,8 +50,8 @@
  * Abstract base class for an intermediate pipeline stage or pipeline source
  * stage implementing whose elements are of type {@code U}.
  *
- * @param <P_IN> Type of elements in the upstream source.
- * @param <P_OUT> Type of elements in produced by this stage.
+ * @param <P_IN> type of elements in the upstream source
+ * @param <P_OUT> type of elements in produced by this stage
  *
  * @since 1.8
  */
@@ -63,9 +63,9 @@
      * Constructor for the head of a stream pipeline.
      *
      * @param source {@code Supplier<Spliterator>} describing the stream source
-     * @param sourceFlags The source flags for the stream source, described in
+     * @param sourceFlags the source flags for the stream source, described in
      *        {@link StreamOpFlag}
-     * @param parallel True if the pipeline is parallel
+     * @param parallel {@code true} if the pipeline is parallel
      */
     ReferencePipeline(Supplier<? extends Spliterator<?>> source,
                       int sourceFlags, boolean parallel) {
@@ -78,7 +78,7 @@
      * @param source {@code Spliterator} describing the stream source
      * @param sourceFlags The source flags for the stream source, described in
      *        {@link StreamOpFlag}
-     * @param parallel True if the pipeline is parallel
+     * @param parallel {@code true} if the pipeline is parallel
      */
     ReferencePipeline(Spliterator<?> source,
                       int sourceFlags, boolean parallel) {
@@ -95,7 +95,6 @@
         super(upstream, opFlags);
     }
 
-
     // Shape-specific methods
 
     @Override
@@ -501,14 +500,20 @@
 
     //
 
-    /** Source stage of a ReferencePipeline */
+    /**
+     * Source stage of a ReferencePipeline.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @param <E_OUT> type of elements in produced by this stage
+     * @since 1.8
+     */
     static class Head<E_IN, E_OUT> extends ReferencePipeline<E_IN, E_OUT> {
         /**
          * Constructor for the source stage of a Stream.
          *
          * @param source {@code Supplier<Spliterator>} describing the stream
          *               source
-         * @param sourceFlags The source flags for the stream source, described
+         * @param sourceFlags the source flags for the stream source, described
          *                    in {@link StreamOpFlag}
          */
         Head(Supplier<? extends Spliterator<?>> source,
@@ -520,7 +525,7 @@
          * Constructor for the source stage of a Stream.
          *
          * @param source {@code Spliterator} describing the stream source
-         * @param sourceFlags The source flags for the stream source, described
+         * @param sourceFlags the source flags for the stream source, described
          *                    in {@link StreamOpFlag}
          */
         Head(Spliterator<?> source,
@@ -561,12 +566,19 @@
         }
     }
 
-    /** Base class for a stateless intermediate stage of a Stream */
+    /**
+     * Base class for a stateless intermediate stage of a Stream.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @param <E_OUT> type of elements in produced by this stage
+     * @since 1.8
+     */
     abstract static class StatelessOp<E_IN, E_OUT>
             extends ReferencePipeline<E_IN, E_OUT> {
         /**
          * Construct a new Stream by appending a stateless intermediate
          * operation to an existing stream.
+         *
          * @param upstream The upstream pipeline stage
          * @param inputShape The stream shape for the upstream pipeline stage
          * @param opFlags Operation flags for the new stage
@@ -584,7 +596,13 @@
         }
     }
 
-    /** Base class for a stateful intermediate stage of a Stream */
+    /**
+     * Base class for a stateful intermediate stage of a Stream.
+     *
+     * @param <E_IN> type of elements in the upstream source
+     * @param <E_OUT> type of elements in produced by this stage
+     * @since 1.8
+     */
     abstract static class StatefulOp<E_IN, E_OUT>
             extends ReferencePipeline<E_IN, E_OUT> {
         /**
--- a/src/share/classes/java/util/stream/SliceOps.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/SliceOps.java	Tue Apr 23 19:34:32 2013 -0700
@@ -45,10 +45,10 @@
      * Appends a "slice" operation to the provided stream.  The slice operation
      * may be may be skip-only, limit-only, or skip-and-limit.
      *
-     * @param <T> The type of both input and output elements
-     * @param upstream A reference stream with element type T
-     * @param skip The number of elements to skip.  Must be >= 0.
-     * @param limit The maximum size of the resulting stream, or -1 if no limit
+     * @param <T> the type of both input and output elements
+     * @param upstream a reference stream with element type T
+     * @param skip the number of elements to skip.  Must be >= 0.
+     * @param limit the maximum size of the resulting stream, or -1 if no limit
      *        is to be imposed
      */
     public static<T> Stream<T> makeRef(AbstractPipeline<?, T, ?> upstream,
@@ -265,7 +265,7 @@
     // @@@ Should take into account ORDERED flag; if not ORDERED, we can limit in temporal order instead
 
     /**
-     * {@code ForkJoinTask} implementing slice computation
+     * {@code ForkJoinTask} implementing slice computation.
      *
      * @param <P_IN> Input element type to the stream pipeline
      * @param <P_OUT> Output element type from the stream pipeline
@@ -410,8 +410,8 @@
         }
 
         /**
-         * Return a new node describing the reslut of truncating an existing Node
-         * at the left and/or right
+         * Return a new node describing the result of truncating an existing Node
+         * at the left and/or right.
          */
         private Node<P_OUT> truncateNode(Node<P_OUT> input,
                                          long skipLeft, long skipRight) {
--- a/src/share/classes/java/util/stream/SortedOps.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/SortedOps.java	Tue Apr 23 19:34:32 2013 -0700
@@ -46,8 +46,8 @@
     /**
      * Appends a "sorted" operation to the provided stream.
      *
-     * @param <T> The type of both input and output elements
-     * @param upstream A reference stream with element type T
+     * @param <T> the type of both input and output elements
+     * @param upstream a reference stream with element type T
      */
     static<T> Stream<T> makeRef(AbstractPipeline<?, T, ?> upstream) {
         return new OfRef<>(upstream);
@@ -56,8 +56,8 @@
     /**
      * Appends a "sorted" operation to the provided stream.
      *
-     * @param <T> The type of both input and output elements
-     * @param upstream A reference stream with element type T
+     * @param <T> the type of both input and output elements
+     * @param upstream a reference stream with element type T
      * @param comparator the comparator to order elements by
      */
     static<T> Stream<T> makeRef(AbstractPipeline<?, T, ?> upstream,
@@ -68,8 +68,8 @@
     /**
      * Appends a "sorted" operation to the provided stream.
      *
-     * @param <T> The type of both input and output elements
-     * @param upstream A reference stream with element type T
+     * @param <T> the type of both input and output elements
+     * @param upstream a reference stream with element type T
      */
     static<T> IntStream makeInt(AbstractPipeline<?, Integer, ?> upstream) {
         return new OfInt(upstream);
@@ -78,8 +78,8 @@
     /**
      * Appends a "sorted" operation to the provided stream.
      *
-     * @param <T> The type of both input and output elements
-     * @param upstream A reference stream with element type T
+     * @param <T> the type of both input and output elements
+     * @param upstream a reference stream with element type T
      */
     static<T> LongStream makeLong(AbstractPipeline<?, Long, ?> upstream) {
         return new OfLong(upstream);
@@ -88,16 +88,20 @@
     /**
      * Appends a "sorted" operation to the provided stream.
      *
-     * @param <T> The type of both input and output elements
-     * @param upstream A reference stream with element type T
+     * @param <T> the type of both input and output elements
+     * @param upstream a reference stream with element type T
      */
     static<T> DoubleStream makeDouble(AbstractPipeline<?, Double, ?> upstream) {
         return new OfDouble(upstream);
     }
 
-    /** Specialized subtype for sorting reference streams */
+    /**
+     * Specialized subtype for sorting reference streams
+     */
     private static final class OfRef<T> extends ReferencePipeline.StatefulOp<T, T> {
-        /** Comparator used for sorting */
+        /**
+         * Comparator used for sorting
+         */
         private final boolean isNaturalSort;
         private final Comparator<? super T> comparator;
 
@@ -157,7 +161,9 @@
         }
     }
 
-    /** Specialized subtype for sorting int streams */
+    /**
+     * Specialized subtype for sorting int streams.
+     */
     private static final class OfInt extends IntPipeline.StatefulOp<Integer> {
         OfInt(AbstractPipeline<?, Integer, ?> upstream) {
             super(upstream, StreamShape.INT_VALUE,
@@ -194,7 +200,9 @@
         }
     }
 
-    /** Specialized subtype for sorting long streams */
+    /**
+     * Specialized subtype for sorting long streams.
+     */
     private static final class OfLong extends LongPipeline.StatefulOp<Long> {
         OfLong(AbstractPipeline<?, Long, ?> upstream) {
             super(upstream, StreamShape.LONG_VALUE,
@@ -231,7 +239,9 @@
         }
     }
 
-    /** Specialized subtype for sorting double streams */
+    /**
+     * Specialized subtype for sorting double streams.
+     */
     private static final class OfDouble extends DoublePipeline.StatefulOp<Double> {
         OfDouble(AbstractPipeline<?, Double, ?> upstream) {
             super(upstream, StreamShape.DOUBLE_VALUE,
@@ -268,7 +278,9 @@
         }
     }
 
-    /** {@link ForkJoinTask} for implementing sort on SIZED reference streams */
+    /**
+     * {@link ForkJoinTask} for implementing sort on SIZED reference streams.
+     */
     private static final class SizedRefSortingSink<T> extends Sink.ChainedReference<T> {
         private final Comparator<? super T> comparator;
         private T[] array;
@@ -306,7 +318,9 @@
         }
     }
 
-    /** {@link Sink} for implementing sort on reference streams */
+    /**
+     * {@link Sink} for implementing sort on reference streams.
+     */
     private static final class RefSortingSink<T> extends Sink.ChainedReference<T> {
         private final Comparator<? super T> comparator;
         private ArrayList<T> list;
@@ -336,7 +350,9 @@
         }
     }
 
-    /** {@link Sink} for implementing sort on SIZED int streams */
+    /**
+     * {@link Sink} for implementing sort on SIZED int streams.
+     */
     private static final class SizedIntSortingSink extends Sink.ChainedInt {
         private int[] array;
         private int offset;
@@ -368,7 +384,9 @@
         }
     }
 
-    /** {@link Sink} for implementing sort on int streams */
+    /**
+     * {@link Sink} for implementing sort on int streams.
+     */
     private static final class IntSortingSink extends Sink.ChainedInt {
         private SpinedBuffer.OfInt b;
 
@@ -397,7 +415,9 @@
         }
     }
 
-    /** {@link Sink} for implementing sort on SIZED long streams */
+    /**
+     * {@link Sink} for implementing sort on SIZED long streams.
+     */
     private static final class SizedLongSortingSink extends Sink.ChainedLong {
         private long[] array;
         private int offset;
@@ -429,7 +449,9 @@
         }
     }
 
-    /** {@link Sink} for implementing sort on long streams */
+    /**
+     * {@link Sink} for implementing sort on long streams.
+     */
     private static final class LongSortingSink extends Sink.ChainedLong {
         private SpinedBuffer.OfLong b;
 
@@ -458,7 +480,9 @@
         }
     }
 
-    /** {@link Sink} for implementing sort on SIZED double streams */
+    /**
+     * {@link Sink} for implementing sort on SIZED double streams.
+     */
     private static final class SizedDoubleSortingSink extends Sink.ChainedDouble {
         private double[] array;
         private int offset;
@@ -490,7 +514,9 @@
         }
     }
 
-    /** {@link Sink} for implementing sort on double streams */
+    /**
+     * {@link Sink} for implementing sort on double streams.
+     */
     private static final class DoubleSortingSink extends Sink.ChainedDouble {
         private SpinedBuffer.OfDouble b;
 
--- a/src/share/classes/java/util/stream/SpinedBuffer.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/SpinedBuffer.java	Tue Apr 23 19:34:32 2013 -0700
@@ -71,17 +71,16 @@
      * array, curChunk becomes the first element in it.  When we clear the
      * buffer, we discard all chunks except the first one, which we clear,
      * restoring it to the initial single-chunk state.
-     *
      */
 
     /**
      * Chunk that we're currently writing into; may or may not be aliased with
-     * the first element of the spine
+     * the first element of the spine.
      */
     protected E[] curChunk;
 
     /**
-     * All chunks, or null if there is only one chunk
+     * All chunks, or null if there is only one chunk.
      */
     protected E[][] spine;
 
@@ -144,14 +143,14 @@
     }
 
     /**
-     * Force the buffer to increase its capacity
+     * Force the buffer to increase its capacity.
      */
     protected void increaseCapacity() {
         ensureCapacity(capacity() + 1);
     }
 
     /**
-     * Retrieve the element at the specified index
+     * Retrieve the element at the specified index.
      */
     public E get(long index) {
         // @@@ can further optimize by caching last seen spineIndex,
@@ -175,7 +174,7 @@
 
     /**
      * Copy the elements, starting at the specified offset, into the specified
-     * array
+     * array.
      */
     public void copyInto(E[] array, int offset) {
         long finalOffset = offset + count();
@@ -198,7 +197,7 @@
 
     /**
      * Create a new array using the specified array factory, and copy the
-     * elements into it
+     * elements into it.
      */
     public E[] asArray(IntFunction<E[]> arrayFactory) {
         // @@@ will fail for size == MAX_VALUE
@@ -267,7 +266,7 @@
             = Spliterator.SIZED | Spliterator.ORDERED | Spliterator.SUBSIZED;
 
     /**
-     * Return a {@link Spliterator} describing the contents of the buffer
+     * Return a {@link Spliterator} describing the contents of the buffer.
      */
     public Spliterator<E> spliterator() {
         return new Spliterator<E>() {
--- a/src/share/classes/java/util/stream/StreamSpliterators.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/StreamSpliterators.java	Tue Apr 23 19:34:32 2013 -0700
@@ -58,7 +58,9 @@
         // @@@ Detect if stateful operations are present or not
         //     If not then can split otherwise cannot
 
-        /** True if this spliterator supports splitting */
+        /**
+         * True if this spliterator supports splitting
+         */
         final boolean isParallel;
 
         final PipelineHelper<P_OUT> ph;
@@ -100,8 +102,10 @@
          */
         boolean finished;
 
-        /** Construct an AbstractWrappingSpliterator from a
-         * {@code Supplier<Spliterator>}. */
+        /**
+         * Construct an AbstractWrappingSpliterator from a
+         * {@code Supplier<Spliterator>}.
+         */
         AbstractWrappingSpliterator(PipelineHelper<P_OUT> ph,
                                     Supplier<Spliterator<P_IN>> spliteratorSupplier,
                                     boolean parallel) {
@@ -111,8 +115,10 @@
             this.isParallel = parallel;
         }
 
-        /** Construct an AbstractWrappingSpliterator from a
-         * {@code Spliterator}. */
+        /**
+         * Construct an AbstractWrappingSpliterator from a
+         * {@code Spliterator}.
+         */
         AbstractWrappingSpliterator(PipelineHelper<P_OUT> ph,
                                     Spliterator<P_IN> spliterator,
                                     boolean parallel) {
@@ -122,7 +128,9 @@
             this.isParallel = parallel;
         }
 
-        /** Called before advancing to set up spliterator, if needed */
+        /**
+         * Called before advancing to set up spliterator, if needed.
+         */
         final void init() {
             if (spliterator == null) {
                 spliterator = spliteratorSupplier.get();
@@ -160,13 +168,13 @@
 
         /**
          * Invokes the shape-specific constructor with the provided arguments
-         * and returns the result
+         * and returns the result.
          */
         abstract AbstractWrappingSpliterator<P_IN, P_OUT, ?> wrap(Spliterator<P_IN> s);
 
         /**
          * Initializes buffer, sink chain, and pusher for a shape-specific
-         * implementation
+         * implementation.
          */
         abstract void initPartialTraversalState();
 
--- a/src/share/classes/java/util/stream/StreamSupport.java	Tue Apr 23 15:04:24 2013 -0700
+++ b/src/share/classes/java/util/stream/StreamSupport.java	Tue Apr 23 19:34:32 2013 -0700
@@ -35,7 +35,7 @@
  * of their data structures; most static stream methods for end users are in
  * {@link Streams}.
  *
- * <p> Unless otherwise stated, streams are created as sequential
+ * <p>Unless otherwise stated, streams are created as sequential
  * streams.  A sequential stream can be transformed into a parallel stream by
  * calling the {@code parallel()} method on the created stream.
  *
@@ -44,11 +44,11 @@
 public class StreamSupport {
     /**
      * Creates a new sequential {@code Stream} from a {@code Spliterator}.
-     * <p>
-     * The spliterator is only traversed, split, or queried for estimated size
-     * after the terminal operation of the stream pipeline commences.
-     * <p>
-     * It is strongly recommended the spliterator report a characteristic of
+     *
+     * <p>The spliterator is only traversed, split, or queried for estimated
+     * size after the terminal operation of the stream pipeline commences.
+     *
+     * <p>It is strongly recommended the spliterator report a characteristic of
      * {@code IMMUTABLE} or {@code CONCURRENT}, or be
      * <a href="Spliterator.html#binding">late-binding</a>.  Otherwise,
      * {@link #stream(Supplier, int)} should be used to
@@ -56,9 +56,9 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param spliterator A {@code Spliterator} describing the stream elements
-     * @param <T> The type of stream elements
-     * @return A new sequential {@code Stream}
+     * @param <T> the type of stream elements
+     * @param spliterator a {@code Spliterator} describing the stream elements
+     * @return a new sequential {@code Stream}
      */
     public static<T> Stream<T> stream(Spliterator<T> spliterator) {
         Objects.requireNonNull(spliterator);
@@ -69,11 +69,11 @@
 
     /**
      * Creates a new parallel {@code Stream} from a {@code Spliterator}.
-     * <p>
-     * The spliterator is only traversed, split, or queried for estimated size
-     * after the terminal operation of the stream pipeline commences.
-     * <p>
-     * It is strongly recommended the spliterator report a characteristic of
+     *
+     * <p>The spliterator is only traversed, split, or queried for estimated
+     * size after the terminal operation of the stream pipeline commences.
+     *
+     * <p>It is strongly recommended the spliterator report a characteristic of
      * {@code IMMUTABLE} or {@code CONCURRENT}, or be
      * <a href="Spliterator.html#binding">late-binding</a>.  Otherwise,
      * {@link #stream(Supplier, int)} should be used to
@@ -81,9 +81,9 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param spliterator A {@code Spliterator} describing the stream elements
-     * @param <T> The type of stream elements
-     * @return A new parallel {@code Stream}
+     * @param <T> the type of stream elements
+     * @param spliterator a {@code Spliterator} describing the stream elements
+     * @return a new parallel {@code Stream}
      */
     public static<T> Stream<T> parallelStream(Spliterator<T> spliterator) {
         Objects.requireNonNull(spliterator);
@@ -95,12 +95,12 @@
     /**
      * Creates a new sequential {@code Stream} from a {@code Supplier} of
      * {@code Spliterator}.
-     * <p>
-     * The {@link Supplier#get()} method will be invoked on the supplier no
+     *
+     * <p>The {@link Supplier#get()} method will be invoked on the supplier no
      * more than once, and after the terminal operation of the stream pipeline
      * commences.
-     * <p>
-     * For spliterators that report a characteristic of {@code IMMUTABLE}
+     *
+     * <p>For spliterators that report a characteristic of {@code IMMUTABLE}
      * or {@code CONCURRENT}, or that are
      * <a href="Spliterator.html#binding">late-binding</a>, it is likely
      * more efficient to use {@link #stream(java.util.Spliterator)} instead.
@@ -112,12 +112,12 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param supplier A {@code Supplier} of a {@code Spliterator}
+     * @param <T> the type of stream elements
+     * @param supplier a {@code Supplier} of a {@code Spliterator}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator}.  The characteristics must be equal to
-     *        {@code source.get().getCharacteristics()}
-     * @param <T> The type of stream elements
-     * @return A new sequential {@code Stream}
+     *        {@code source.get().getCharacteristics()}.
+     * @return a new sequential {@code Stream}
      * @see #stream(Spliterator)
      */
     public static<T> Stream<T> stream(Supplier<? extends Spliterator<T>> supplier,
@@ -131,12 +131,12 @@
     /**
      * Creates a new parallel {@code Stream} from a {@code Supplier} of
      * {@code Spliterator}.
-     * <p>
-     * The {@link Supplier#get()} method will be invoked on the supplier no
+     *
+     * <p>The {@link Supplier#get()} method will be invoked on the supplier no
      * more than once, and after the terminal operation of the stream pipeline
      * commences.
-     * <p>
-     * For spliterators that report a characteristic of {@code IMMUTABLE}
+     *
+     * <p>For spliterators that report a characteristic of {@code IMMUTABLE}
      * or {@code CONCURRENT}, or that are
      * <a href="Spliterator.html#binding">late-binding</a>, it is likely
      * more efficient to use {@link #stream(Spliterator)} instead.
@@ -148,12 +148,12 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param supplier A {@code Supplier} of a {@code Spliterator}
+     * @param <T> the type of stream elements
+     * @param supplier a {@code Supplier} of a {@code Spliterator}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator}.  The characteristics must be equal to
      *        {@code source.get().getCharacteristics()}
-     * @param <T> The type of stream elements
-     * @return A new parallel {@code Stream}
+     * @return a new parallel {@code Stream}
      * @see #parallelStream(Spliterator)
      */
     public static<T> Stream<T> parallelStream(Supplier<? extends Spliterator<T>> supplier,
@@ -166,11 +166,11 @@
 
     /**
      * Creates a new sequential {@code IntStream} from a {@code Spliterator.OfInt}.
-     * <p>
-     * The spliterator is only traversed, split, or queried for estimated size
+     *
+     * <p>The spliterator is only traversed, split, or queried for estimated size
      * after the terminal operation of the stream pipeline commences.
-     * <p>
-     * It is strongly recommended the spliterator report a characteristic of
+     *
+     * <p>It is strongly recommended the spliterator report a characteristic of
      * {@code IMMUTABLE} or {@code CONCURRENT}, or be
      * <a href="Spliterator.html#binding">late-binding</a>.  Otherwise,
      * {@link #stream(Supplier, int)}} should be used to
@@ -178,8 +178,8 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param spliterator A {@code Spliterator.OfInt} describing the stream elements
-     * @return A new sequential {@code IntStream}
+     * @param spliterator a {@code Spliterator.OfInt} describing the stream elements
+     * @return a new sequential {@code IntStream}
      */
     public static IntStream intStream(Spliterator.OfInt spliterator) {
         return new IntPipeline.Head<>(spliterator,
@@ -189,11 +189,11 @@
 
     /**
      * Creates a new parallel {@code IntStream} from a {@code Spliterator.OfInt}.
-     * <p>
-     * The spliterator is only traversed, split, or queried for estimated size
+     *
+     * <p>he spliterator is only traversed, split, or queried for estimated size
      * after the terminal operation of the stream pipeline commences.
-     * <p>
-     * It is strongly recommended the spliterator report a characteristic of
+     *
+     * <p>It is strongly recommended the spliterator report a characteristic of
      * {@code IMMUTABLE} or {@code CONCURRENT}, or be
      * <a href="Spliterator.html#binding">late-binding</a>.  Otherwise,
      * {@link #stream(Supplier, int)}} should be used to
@@ -201,8 +201,8 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param spliterator A {@code Spliterator.OfInt} describing the stream elements
-     * @return A new parallel {@code IntStream}
+     * @param spliterator a {@code Spliterator.OfInt} describing the stream elements
+     * @return a new parallel {@code IntStream}
      */
     public static IntStream intParallelStream(Spliterator.OfInt spliterator) {
         return new IntPipeline.Head<>(spliterator,
@@ -213,12 +213,12 @@
     /**
      * Creates a new sequential {@code IntStream} from a {@code Supplier} of
      * {@code Spliterator.OfInt}.
-     * <p>
-     * The {@link Supplier#get()} method will be invoked on the supplier no
+     *
+     * <p>The {@link Supplier#get()} method will be invoked on the supplier no
      * more than once, and after the terminal operation of the stream pipeline
      * commences.
-     * <p>
-     * For spliterators that report a characteristic of {@code IMMUTABLE}
+     *
+     * <p>For spliterators that report a characteristic of {@code IMMUTABLE}
      * or {@code CONCURRENT}, or that are
      * <a href="Spliterator.html#binding">late-binding</a>, it is likely
      * more efficient to use {@link #intStream(Spliterator.OfInt)} instead.
@@ -230,11 +230,11 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param supplier A {@code Supplier} of a {@code Spliterator.OfInt}
+     * @param supplier a {@code Supplier} of a {@code Spliterator.OfInt}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator.OfInt}.  The characteristics must be equal to
      *        {@code source.get().getCharacteristics()}
-     * @return A new sequential {@code IntStream}
+     * @return a new sequential {@code IntStream}
      * @see #intStream(Spliterator.OfInt)
      */
     public static IntStream intStream(Supplier<? extends Spliterator.OfInt> supplier,
@@ -247,12 +247,12 @@
     /**
      * Creates a new parallel {@code IntStream} from a {@code Supplier} of
      * {@code Spliterator.OfInt}.
-     * <p>
-     * The {@link Supplier#get()} method will be invoked on the supplier no
+     *
+     * <p>The {@link Supplier#get()} method will be invoked on the supplier no
      * more than once, and after the terminal operation of the stream pipeline
      * commences.
-     * <p>
-     * For spliterators that report a characteristic of {@code IMMUTABLE}
+     *
+     * <p>For spliterators that report a characteristic of {@code IMMUTABLE}
      * or {@code CONCURRENT}, or that are
      * <a href="Spliterator.html#binding">late-binding</a>, it is likely
      * more efficient to use {@link #intStream(Spliterator.OfInt)} instead.
@@ -264,11 +264,11 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param supplier A {@code Supplier} of a {@code Spliterator.OfInt}
+     * @param supplier a {@code Supplier} of a {@code Spliterator.OfInt}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator.OfInt}.  The characteristics must be equal to
      *        {@code source.get().getCharacteristics()}
-     * @return A new parallel {@code IntStream}
+     * @return a new parallel {@code IntStream}
      * @see #intParallelStream(Spliterator.OfInt)
      */
     public static IntStream intParallelStream(Supplier<? extends Spliterator.OfInt> supplier,
@@ -280,11 +280,11 @@
 
     /**
      * Creates a new sequential {@code LongStream} from a {@code Spliterator.OfLong}.
-     * <p>
-     * The spliterator is only traversed, split, or queried for estimated size
-     * after the terminal operation of the stream pipeline commences.
-     * <p>
-     * It is strongly recommended the spliterator report a characteristic of
+     *
+     * <p>The spliterator is only traversed, split, or queried for estimated
+     * size after the terminal operation of the stream pipeline commences.
+     *
+     * <p>It is strongly recommended the spliterator report a characteristic of
      * {@code IMMUTABLE} or {@code CONCURRENT}, or be
      * <a href="Spliterator.html#binding">late-binding</a>.  Otherwise,
      * {@link #stream(Supplier, int)} should be used to
@@ -292,8 +292,9 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param spliterator A {@code Spliterator.OfLong} describing the stream elements
-     * @return A new sequential {@code LongStream}
+     * @param spliterator a {@code Spliterator.OfLong} describing the stream
+     * elements
+     * @return a new sequential {@code LongStream}
      */
     public static LongStream longStream(Spliterator.OfLong spliterator) {
         return new LongPipeline.Head<>(spliterator,
@@ -303,11 +304,11 @@
 
     /**
      * Creates a new parallel {@code LongStream} from a {@code Spliterator.OfLong}.
-     * <p>
-     * The spliterator is only traversed, split, or queried for estimated size
-     * after the terminal operation of the stream pipeline commences.
-     * <p>
-     * It is strongly recommended the spliterator report a characteristic of
+     *
+     * <p>The spliterator is only traversed, split, or queried for estimated
+     * size after the terminal operation of the stream pipeline commences.
+     *
+     * <p>It is strongly recommended the spliterator report a characteristic of
      * {@code IMMUTABLE} or {@code CONCURRENT}, or be
      * <a href="Spliterator.html#binding">late-binding</a>.  Otherwise,
      * {@link #stream(Supplier, int)} should be used to
@@ -315,8 +316,8 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param spliterator A {@code Spliterator.OfLong} describing the stream elements
-     * @return A new parallel {@code LongStream}
+     * @param spliterator a {@code Spliterator.OfLong} describing the stream elements
+     * @return a new parallel {@code LongStream}
      */
     public static LongStream longParallelStream(Spliterator.OfLong spliterator) {
         return new LongPipeline.Head<>(spliterator,
@@ -327,12 +328,12 @@
     /**
      * Creates a new sequential {@code LongStream} from a {@code Supplier} of
      * {@code Spliterator.OfLong}.
-     * <p>
-     * The {@link Supplier#get()} method will be invoked on the supplier no
+     *
+     * <p>The {@link Supplier#get()} method will be invoked on the supplier no
      * more than once, and after the terminal operation of the stream pipeline
      * commences.
-     * <p>
-     * For spliterators that report a characteristic of {@code IMMUTABLE}
+     *
+     * <p>For spliterators that report a characteristic of {@code IMMUTABLE}
      * or {@code CONCURRENT}, or that are
      * <a href="Spliterator.html#binding">late-binding</a>, it is likely
      * more efficient to use {@link #longStream(Spliterator.OfLong)} instead.
@@ -344,11 +345,11 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param supplier A {@code Supplier} of a {@code Spliterator.OfLong}
+     * @param supplier a {@code Supplier} of a {@code Spliterator.OfLong}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator.OfLong}.  The characteristics must be equal to
      *        {@code source.get().getCharacteristics()}
-     * @return A new sequential {@code LongStream}
+     * @return a new sequential {@code LongStream}
      * @see #longStream(Spliterator.OfLong)
      */
     public static LongStream longStream(Supplier<? extends Spliterator.OfLong> supplier,
@@ -361,12 +362,12 @@
     /**
      * Creates a new parallel {@code LongStream} from a {@code Supplier} of
      * {@code Spliterator.OfLong}.
-     * <p>
-     * The {@link Supplier#get()} method will be invoked on the supplier no
+     *
+     * <p>The {@link Supplier#get()} method will be invoked on the supplier no
      * more than once, and after the terminal operation of the stream pipeline
      * commences.
-     * <p>
-     * For spliterators that report a characteristic of {@code IMMUTABLE}
+     *
+     * <p>For spliterators that report a characteristic of {@code IMMUTABLE}
      * or {@code CONCURRENT}, or that are
      * <a href="Spliterator.html#binding">late-binding</a>, it is likely
      * more efficient to use {@link #longStream(Spliterator.OfLong)} instead.
@@ -393,12 +394,13 @@
     }
 
     /**
-     * Creates a new sequential {@code DoubleStream} from a {@code Spliterator.OfDouble}.
-     * <p>
-     * The spliterator is only traversed, split, or queried for estimated size
+     * Creates a new sequential {@code DoubleStream} from a
+     * {@code Spliterator.OfDouble}.
+     *
+     * <p>The spliterator is only traversed, split, or queried for estimated size
      * after the terminal operation of the stream pipeline commences.
-     * <p>
-     * It is strongly recommended the spliterator report a characteristic of
+     *
+     * <p>It is strongly recommended the spliterator report a characteristic of
      * {@code IMMUTABLE} or {@code CONCURRENT}, or be
      * <a href="Spliterator.html#binding">late-binding</a>.  Otherwise,
      * {@link #stream(Supplier, int)} should be used to
@@ -416,12 +418,13 @@
     }
 
     /**
-     * Creates a new parallel {@code DoubleStream} from a {@code Spliterator.OfDouble}.
-     * <p>
-     * The spliterator is only traversed, split, or queried for estimated size
+     * Creates a new parallel {@code DoubleStream} from a
+     * {@code Spliterator.OfDouble}.
+     *
+     * <p>The spliterator is only traversed, split, or queried for estimated size
      * after the terminal operation of the stream pipeline commences.
-     * <p>
-     * It is strongly recommended the spliterator report a characteristic of
+     *
+     * <p>It is strongly recommended the spliterator report a characteristic of
      * {@code IMMUTABLE} or {@code CONCURRENT}, or be
      * <a href="Spliterator.html#binding">late-binding</a>.  Otherwise,
      * {@link #stream(Supplier, int)} should be used to
@@ -475,12 +478,12 @@
     /**
      * Creates a new parallel {@code DoubleStream} from a {@code Supplier} of
      * {@code Spliterator.OfDouble}.
-     * <p>
-     * The {@link Supplier#get()} method will be invoked on the supplier no
+     *
+     * <p>The {@link Supplier#get()} method will be invoked on the supplier no
      * more than once, and after the terminal operation of the stream pipeline
      * commences.
-     * <p>
-     * For spliterators that report a characteristic of {@code IMMUTABLE}
+     *
+     * <p>For spliterators that report a characteristic of {@code IMMUTABLE}
      * or {@code CONCURRENT}, or that are
      * <a href="Spliterator.html#binding">late-binding</a>, it is likely
      * more efficient to use {@link #doubleStream(Spliterator.OfDouble)} instead.
@@ -492,11 +495,11 @@
      * <a href="package-summary.html#Non-Interference">Non-Interference</a> for
      * more details.
      *
-     * @param supplier A {@code Supplier} of a {@code Spliterator.OfDouble}
+     * @param supplier a {@code Supplier} of a {@code Spliterator.OfDouble}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator.OfDouble}.  The characteristics must be equal to
      *        {@code source.get().getCharacteristics()}
-     * @return A new parallel {@code DoubleStream}
+     * @return a new parallel {@code DoubleStream}
      * @see #doubleParallelStream(Spliterator.OfDouble)
      */
     public static DoubleStream doubleParallelStream(Supplier<? extends Spliterator.OfDouble> supplier,