changeset 12488:747e494248f2

8130828: Fix some typos and omissions in the the j.u.stream JavaDoc Reviewed-by: smarks
author psandoz
date Fri, 31 Jul 2015 12:29:01 +0200
parents 903fb2f4acb3
children 339e2b4a5241
files src/java.base/share/classes/java/util/stream/Collector.java src/java.base/share/classes/java/util/stream/DoubleStream.java src/java.base/share/classes/java/util/stream/IntStream.java src/java.base/share/classes/java/util/stream/LongStream.java src/java.base/share/classes/java/util/stream/SliceOps.java src/java.base/share/classes/java/util/stream/Stream.java src/java.base/share/classes/java/util/stream/Streams.java
diffstat 7 files changed, 24 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/util/stream/Collector.java	Thu Jul 30 22:21:56 2015 -0700
+++ b/src/java.base/share/classes/java/util/stream/Collector.java	Fri Jul 31 12:29:01 2015 +0200
@@ -223,7 +223,7 @@
      * Perform the final transformation from the intermediate accumulation type
      * {@code A} to the final result type {@code R}.
      *
-     * <p>If the characteristic {@code IDENTITY_TRANSFORM} is
+     * <p>If the characteristic {@code IDENTITY_FINISH} is
      * set, this function may be presumed to be an identity transform with an
      * unchecked cast from {@code A} to {@code R}.
      *
--- a/src/java.base/share/classes/java/util/stream/DoubleStream.java	Thu Jul 30 22:21:56 2015 -0700
+++ b/src/java.base/share/classes/java/util/stream/DoubleStream.java	Fri Jul 31 12:29:01 2015 +0200
@@ -293,7 +293,7 @@
      *
      * <p>Independent of whether this stream is ordered or unordered if all
      * elements of this stream match the given predicate then this operation
-     * takes all elements (the result is the same is the input), or if no
+     * takes all elements (the result is the same as the input), or if no
      * elements of the stream match the given predicate then no elements are
      * taken (the result is an empty stream).
      *
@@ -329,6 +329,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
+     * @since 1.9
      */
     default DoubleStream takeWhile(DoublePredicate predicate) {
         Objects.requireNonNull(predicate);
@@ -361,7 +362,7 @@
      * elements of this stream match the given predicate then this operation
      * drops all elements (the result is an empty stream), or if no elements of
      * the stream match the given predicate then no elements are dropped (the
-     * result is the same is the input).
+     * result is the same as the input).
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
@@ -395,6 +396,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
+     * @since 1.9
      */
     default DoubleStream dropWhile(DoublePredicate predicate) {
         Objects.requireNonNull(predicate);
--- a/src/java.base/share/classes/java/util/stream/IntStream.java	Thu Jul 30 22:21:56 2015 -0700
+++ b/src/java.base/share/classes/java/util/stream/IntStream.java	Fri Jul 31 12:29:01 2015 +0200
@@ -291,7 +291,7 @@
      *
      * <p>Independent of whether this stream is ordered or unordered if all
      * elements of this stream match the given predicate then this operation
-     * takes all elements (the result is the same is the input), or if no
+     * takes all elements (the result is the same as the input), or if no
      * elements of the stream match the given predicate then no elements are
      * taken (the result is an empty stream).
      *
@@ -326,6 +326,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
+     * @since 1.9
      */
     default IntStream takeWhile(IntPredicate predicate) {
         Objects.requireNonNull(predicate);
@@ -358,7 +359,7 @@
      * elements of this stream match the given predicate then this operation
      * drops all elements (the result is an empty stream), or if no elements of
      * the stream match the given predicate then no elements are dropped (the
-     * result is the same is the input).
+     * result is the same as the input).
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
@@ -391,6 +392,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
+     * @since 1.9
      */
     default IntStream dropWhile(IntPredicate predicate) {
         Objects.requireNonNull(predicate);
--- a/src/java.base/share/classes/java/util/stream/LongStream.java	Thu Jul 30 22:21:56 2015 -0700
+++ b/src/java.base/share/classes/java/util/stream/LongStream.java	Fri Jul 31 12:29:01 2015 +0200
@@ -291,7 +291,7 @@
      *
      * <p>Independent of whether this stream is ordered or unordered if all
      * elements of this stream match the given predicate then this operation
-     * takes all elements (the result is the same is the input), or if no
+     * takes all elements (the result is the same as the input), or if no
      * elements of the stream match the given predicate then no elements are
      * taken (the result is an empty stream).
      *
@@ -327,6 +327,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
+     * @since 1.9
      */
     default LongStream takeWhile(LongPredicate predicate) {
         Objects.requireNonNull(predicate);
@@ -359,7 +360,7 @@
      * elements of this stream match the given predicate then this operation
      * drops all elements (the result is an empty stream), or if no elements of
      * the stream match the given predicate then no elements are dropped (the
-     * result is the same is the input).
+     * result is the same as the input).
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
@@ -393,6 +394,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
+     * @since 1.9
      */
     default LongStream dropWhile(LongPredicate predicate) {
         Objects.requireNonNull(predicate);
--- a/src/java.base/share/classes/java/util/stream/SliceOps.java	Thu Jul 30 22:21:56 2015 -0700
+++ b/src/java.base/share/classes/java/util/stream/SliceOps.java	Fri Jul 31 12:29:01 2015 +0200
@@ -138,7 +138,7 @@
                             skip, limit, size);
                 }
                 else {
-                    // @@@ OOMEs will occur for LongStream.longs().filter(i -> true).limit(n)
+                    // @@@ OOMEs will occur for LongStream.range(0, Long.MAX_VALUE).filter(i -> true).limit(n)
                     //     regardless of the value of n
                     //     Need to adjust the target size of splitting for the
                     //     SliceTask from say (size / k) to say min(size / k, 1 << 14)
--- a/src/java.base/share/classes/java/util/stream/Stream.java	Thu Jul 30 22:21:56 2015 -0700
+++ b/src/java.base/share/classes/java/util/stream/Stream.java	Fri Jul 31 12:29:01 2015 +0200
@@ -498,7 +498,7 @@
      *
      * <p>Independent of whether this stream is ordered or unordered if all
      * elements of this stream match the given predicate then this operation
-     * takes all elements (the result is the same is the input), or if no
+     * takes all elements (the result is the same as the input), or if no
      * elements of the stream match the given predicate then no elements are
      * taken (the result is an empty stream).
      *
@@ -533,6 +533,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
+     * @since 1.9
      */
     default Stream<T> takeWhile(Predicate<? super T> predicate) {
         Objects.requireNonNull(predicate);
@@ -565,7 +566,7 @@
      * elements of this stream match the given predicate then this operation
      * drops all elements (the result is an empty stream), or if no elements of
      * the stream match the given predicate then no elements are dropped (the
-     * result is the same is the input).
+     * result is the same as the input).
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
@@ -598,6 +599,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
+     * @since 1.9
      */
     default Stream<T> dropWhile(Predicate<? super T> predicate) {
         Objects.requireNonNull(predicate);
--- a/src/java.base/share/classes/java/util/stream/Streams.java	Thu Jul 30 22:21:56 2015 -0700
+++ b/src/java.base/share/classes/java/util/stream/Streams.java	Fri Jul 31 12:29:01 2015 +0200
@@ -156,10 +156,9 @@
          * than a balanced tree at the expense of a higher-depth for the right
          * side of the range.
          *
-         * <p>This is optimized for cases such as IntStream.ints() that is
-         * implemented as range of 0 to Integer.MAX_VALUE but is likely to be
-         * augmented with a limit operation that limits the number of elements
-         * to a count lower than this threshold.
+         * <p>This is optimized for cases such as IntStream.range(0, Integer.MAX_VALUE)
+         * that is likely to be augmented with a limit operation that limits the
+         * number of elements to a count lower than this threshold.
          */
         private static final int BALANCED_SPLIT_THRESHOLD = 1 << 24;
 
@@ -280,10 +279,9 @@
          * than a balanced tree at the expense of a higher-depth for the right
          * side of the range.
          *
-         * <p>This is optimized for cases such as LongStream.longs() that is
-         * implemented as range of 0 to Long.MAX_VALUE but is likely to be
-         * augmented with a limit operation that limits the number of elements
-         * to a count lower than this threshold.
+         * <p>This is optimized for cases such as LongStream.range(0, Long.MAX_VALUE)
+         * that is likely to be augmented with a limit operation that limits the
+         * number of elements to a count lower than this threshold.
          */
         private static final long BALANCED_SPLIT_THRESHOLD = 1 << 24;