changeset 7553:45f88e5c6964

Small cleanups.
author psandoz
date Fri, 01 Mar 2013 18:31:40 +0100
parents 996188a59559
children c9c3e504e55b
files src/share/classes/java/util/stream/AbstractTask.java src/share/classes/java/util/stream/FindOp.java src/share/classes/java/util/stream/ForEachOp.java src/share/classes/java/util/stream/ForEachUntilOp.java src/share/classes/java/util/stream/IntermediateOp.java src/share/classes/java/util/stream/MatchOp.java src/share/classes/java/util/stream/Node.java src/share/classes/java/util/stream/Sink.java
diffstat 8 files changed, 32 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/stream/AbstractTask.java	Fri Mar 01 16:23:31 2013 +0100
+++ b/src/share/classes/java/util/stream/AbstractTask.java	Fri Mar 01 18:31:40 2013 +0100
@@ -98,8 +98,7 @@
 
     /**
      * This task's first child.  Children are stored in a linked list, using
-     * the {@code nextSibling} field
-     * as the link to the next child.
+     * the {@code nextSibling} field as the link to the next child.
      */
     protected T children;
 
@@ -121,6 +120,7 @@
 
     /**
      * Constructor for non-root nodes
+     *
      * @param parent This node's parent task
      * @param spliterator Spliterator describing the subtree rooted at this
      *        node, obtained by splitting the parent spliterator
@@ -216,6 +216,7 @@
     /**
      * Return the parent of this task, or null if this task is the root
      */
+    @SuppressWarnings("unchecked")
     protected T getParent() {
         return (T) getCompleter();
     }
@@ -232,6 +233,7 @@
      * task should and can be split into left and right tasks.
      */
     @Override
+    @SuppressWarnings("unchecked")
     public final void compute() {
         doCompute((T) this);
     }
@@ -244,7 +246,7 @@
      * compute the rightmost (remaining) child tasks.
      *
      * <p>
-     * Computing will continue for rightmost tasks while a task can be  computed
+     * Computing will continue for rightmost tasks while a task can be computed
      * as determined by {@link #canCompute()} and that task should and can be
      * split into left and right tasks.
      *
--- a/src/share/classes/java/util/stream/FindOp.java	Fri Mar 01 16:23:31 2013 +0100
+++ b/src/share/classes/java/util/stream/FindOp.java	Fri Mar 01 18:31:40 2013 +0100
@@ -173,7 +173,7 @@
      * Construct a {@code FindOp}
      *
      * @param mustFindFirst If true, must find the first element in encounter
-     *       order, otherwise can find any element
+     *        order, otherwise can find any element
      * @param shape Stream shape of elements to search
      * @param emptyValue Result value corresponding to "found nothing"
      * @param presentPredicate {@code Predicate} on result value corresponding
--- a/src/share/classes/java/util/stream/ForEachOp.java	Fri Mar 01 16:23:31 2013 +0100
+++ b/src/share/classes/java/util/stream/ForEachOp.java	Fri Mar 01 18:31:40 2013 +0100
@@ -36,7 +36,7 @@
  * A {@code TerminalOp} that evaluates a stream pipeline and sends the output
  * into a {@code TerminalSink}.  Elements will be passed to the
  * {@code TerminalSink} in whatever thread and whatever order they become
- * available,  independent of the stream's encounter order.
+ * available, independent of the stream's encounter order.
  * @param <T> The output type of the stream pipeline
  * @since 1.8
  */
--- a/src/share/classes/java/util/stream/ForEachUntilOp.java	Fri Mar 01 16:23:31 2013 +0100
+++ b/src/share/classes/java/util/stream/ForEachUntilOp.java	Fri Mar 01 18:31:40 2013 +0100
@@ -67,7 +67,7 @@
      *
      * @param consumer The {@code Consumer} to send stream output to
      * @param until A {@code BooleanSupplier} that indicates whether the
-     *        termination criteria has occurred.  Once it returns @{code true}
+     *        termination criteria has occurred.  Once it returns {@code true}
      *        the first time, it must continue to return {@code true} for all
      *        future invocations
      * @param <T> The type of the stream elements
@@ -95,7 +95,7 @@
      *
      * @param consumer The {@code Consumer} to send stream output to
      * @param until A {@code BooleanSupplier} that indicates whether the
-     *        termination criteria has occurred.  Once it returns @{code true}
+     *        termination criteria has occurred.  Once it returns {@code true}
      *        the first time, it must continue to return {@code true} for all
      *        future invocations
      */
@@ -122,9 +122,9 @@
      *
      * @param consumer The {@code Consumer} to send stream output to
      * @param until A {@code BooleanSupplier} that indicates whether the
-     *              termination criteria has occurred.  Once it returns
-     *              @{code true} the first time, it must continue to return
-     *              {@code true} for all future invocations
+     *        termination criteria has occurred.  Once it returns {@code true}
+     *        the first time, it must continue to return {@code true} for all
+     *        future invocations
      */
     public static ForEachUntilOp<Long> make(final LongConsumer consumer, BooleanSupplier until) {
         Objects.requireNonNull(consumer);
@@ -149,7 +149,7 @@
      *
      * @param consumer The {@code Consumer} to send stream output to
      * @param until A {@code BooleanSupplier} that indicates whether the
-     *        termination criteria has occurred.  Once it returns @{code true}
+     *        termination criteria has occurred.  Once it returns {@code true}
      *        the first time, it must continue to return {@code true} for all
      *        future invocations
      */
--- a/src/share/classes/java/util/stream/IntermediateOp.java	Fri Mar 01 16:23:31 2013 +0100
+++ b/src/share/classes/java/util/stream/IntermediateOp.java	Fri Mar 01 18:31:40 2013 +0100
@@ -92,6 +92,7 @@
 
     /**
      * Get the shape of the input type of this operation
+     *
      * @implSpec The default returns {@code StreamShape.REFERENCE}
      * @return Shape of the input type of this operation
      */
@@ -99,6 +100,7 @@
 
     /**
      * Get the shape of the output type of this operation
+     *
      * @implSpec The default returns {@code StreamShape.REFERENCE}
      * @return Shape of the output type of this operation
      */
@@ -119,7 +121,6 @@
      * overridden.
      *
      * @implSpec The default implementation returns {@code false}.
-     *
      * @return {@code true} if this operation is stateful
      */
     default boolean isStateful() { return false; }
--- a/src/share/classes/java/util/stream/MatchOp.java	Fri Mar 01 16:23:31 2013 +0100
+++ b/src/share/classes/java/util/stream/MatchOp.java	Fri Mar 01 18:31:40 2013 +0100
@@ -49,8 +49,8 @@
      *
      * @param shape The output shape of the stream pipeline
      * @param matchKind The kind of quantified match (all, any, none)
-     * @param sinkSupplier {@code Supplier} for a {@code Sink} of the appropriate
-     *        shape which implements the matching operation
+     * @param sinkSupplier {@code Supplier} for a {@code Sink} of the
+     *        appropriate shape which implements the matching operation
      */
     private MatchOp(StreamShape shape, MatchKind matchKind, Supplier<BooleanTerminalSink<T>> sinkSupplier) {
         this.inputShape = shape;
@@ -91,7 +91,8 @@
      * @param predicate The {@code Predicate} to apply to stream elements
      * @param matchKind The kind of quantified match (all, any, none)
      * @param <T> The type of stream elements
-     * @return A {@code MatchOp} implementing the desired quantified match criteria
+     * @return A {@code MatchOp} implementing the desired quantified match
+     *         criteria
      */
     public static <T> MatchOp<T> match(Predicate<? super T> predicate, MatchKind matchKind) {
         class MatchSink extends BooleanTerminalSink<T> {
@@ -124,7 +125,8 @@
      *
      * @param predicate The {@code Predicate} to apply to stream elements
      * @param matchKind The kind of quantified match (all, any, none)
-     * @return A {@code MatchOp} implementing the desired quantified match criteria
+     * @return A {@code MatchOp} implementing the desired quantified match
+     *         criteria
      */
     public static MatchOp<Integer> match(IntPredicate predicate, MatchKind matchKind) {
         class MatchSink extends BooleanTerminalSink<Integer> implements Sink.OfInt {
@@ -154,7 +156,8 @@
      *
      * @param predicate The {@code Predicate} to apply to stream elements
      * @param matchKind The kind of quantified match (all, any, none)
-     * @return A {@code MatchOp} implementing the desired quantified match criteria
+     * @return A {@code MatchOp} implementing the desired quantified match
+     *         criteria
      */
     public static MatchOp<Long> match(LongPredicate predicate, MatchKind matchKind) {
         class MatchSink extends BooleanTerminalSink<Long> implements Sink.OfLong {
@@ -185,7 +188,8 @@
      *
      * @param predicate The {@code Predicate} to apply to stream elements
      * @param matchKind The kind of quantified match (all, any, none)
-     * @return A {@code MatchOp} implementing the desired quantified match criteria
+     * @return A {@code MatchOp} implementing the desired quantified match
+     *         criteria
      */
     public static MatchOp<Double> match(DoublePredicate predicate, MatchKind matchKind) {
         class MatchSink extends BooleanTerminalSink<Double> implements Sink.OfDouble {
--- a/src/share/classes/java/util/stream/Node.java	Fri Mar 01 16:23:31 2013 +0100
+++ b/src/share/classes/java/util/stream/Node.java	Fri Mar 01 18:31:40 2013 +0100
@@ -131,6 +131,7 @@
 
     /**
      * Get the {@code StreamShape} associated with this {@code Node}.
+     *
      * @implSpec The default in {@code Node} returns
      * {@code StreamShape.REFERENCE}
      * @return the stream shape associated with this node
--- a/src/share/classes/java/util/stream/Sink.java	Fri Mar 01 16:23:31 2013 +0100
+++ b/src/share/classes/java/util/stream/Sink.java	Fri Mar 01 18:31:40 2013 +0100
@@ -41,7 +41,8 @@
  * {@code accept()} without again calling {@code begin()}.  {@code Sink} also
  * offers a mechanism by which the sink can cooperatively signal that it does
  * not wish to receive any more data (the {@code cancellationRequested()}
- * method), which a source can poll before sending more data to the {@code Sink}.
+ * method), which a source can poll before sending more data to the
+ * {@code Sink}.
  *
  * @apiNote
  *
@@ -79,7 +80,7 @@
  * The specialized subtypes such as {@link Sink.OfInt} bridge
  * {@code accept(Object)} to call the appropriate primitive specialization of
  * {@code accept}, implement the appropriate primitive specialization of
- * {@code Consumer}, and reabstract the appropriate primitive specialization of
+ * {@code Consumer}, and re-abstract the appropriate primitive specialization of
  * {@code accept}.
  *
  * The chaining subtypes such as {@link ChainedInt} not only implement
@@ -165,7 +166,7 @@
     }
 
     /**
-     * {@code Sink} that implements {@code Sink<Integer>}, reabstracts
+     * {@code Sink} that implements {@code Sink<Integer>}, re-abstracts
      * {@code accept(int)}, and wires {@code accept(Integer)} to bridge to
      * {@code accept(int)}.
      */
@@ -183,7 +184,7 @@
     }
 
     /**
-     * {@code Sink} that implements {@code Sink<Long>}, reabstracts
+     * {@code Sink} that implements {@code Sink<Long>}, re-abstracts
      * {@code accept(long)}, and wires {@code accept(Long)} to bridge to
      * {@code accept(long)}.
      */
@@ -201,7 +202,7 @@
     }
 
     /**
-     * {@code Sink} that implements {@code Sink<Double>}, reabstracts
+     * {@code Sink} that implements {@code Sink<Double>}, re-abstracts
      * {@code accept(double)}, and wires {@code accept(Double)} to bridge to
      * {@code accept(double)}.
      */