changeset 8976:1298e476729c

8029944: Primitive Stream reduce method documentation pseudo code misidentifies apply method Reviewed-by: mduigou Contributed-by: michael.mcmahon@oracle.com
author michaelm
date Wed, 11 Dec 2013 15:26:47 -0800
parents fe3383582427
children 1970e3c3d202
files src/share/classes/java/util/stream/DoubleStream.java src/share/classes/java/util/stream/IntStream.java src/share/classes/java/util/stream/LongStream.java
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/stream/DoubleStream.java	Wed Dec 11 16:52:41 2013 -0500
+++ b/src/share/classes/java/util/stream/DoubleStream.java	Wed Dec 11 15:26:47 2013 -0800
@@ -329,7 +329,7 @@
      * <pre>{@code
      *     double result = identity;
      *     for (double element : this stream)
-     *         result = accumulator.apply(result, element)
+     *         result = accumulator.applyAsDouble(result, element)
      *     return result;
      * }</pre>
      *
@@ -390,7 +390,7 @@
      *             result = element;
      *         }
      *         else
-     *             result = accumulator.apply(result, element);
+     *             result = accumulator.applyAsDouble(result, element);
      *     }
      *     return foundAny ? OptionalDouble.of(result) : OptionalDouble.empty();
      * }</pre>
--- a/src/share/classes/java/util/stream/IntStream.java	Wed Dec 11 16:52:41 2013 -0500
+++ b/src/share/classes/java/util/stream/IntStream.java	Wed Dec 11 15:26:47 2013 -0800
@@ -322,7 +322,7 @@
      * <pre>{@code
      *     int result = identity;
      *     for (int element : this stream)
-     *         result = accumulator.apply(result, element)
+     *         result = accumulator.applyAsInt(result, element)
      *     return result;
      * }</pre>
      *
@@ -383,7 +383,7 @@
      *             result = element;
      *         }
      *         else
-     *             result = accumulator.apply(result, element);
+     *             result = accumulator.applyAsInt(result, element);
      *     }
      *     return foundAny ? OptionalInt.of(result) : OptionalInt.empty();
      * }</pre>
--- a/src/share/classes/java/util/stream/LongStream.java	Wed Dec 11 16:52:41 2013 -0500
+++ b/src/share/classes/java/util/stream/LongStream.java	Wed Dec 11 15:26:47 2013 -0800
@@ -327,7 +327,7 @@
      * <pre>{@code
      *     long result = identity;
      *     for (long element : this stream)
-     *         result = accumulator.apply(result, element)
+     *         result = accumulator.applyAsLong(result, element)
      *     return result;
      * }</pre>
      *
@@ -388,7 +388,7 @@
      *             result = element;
      *         }
      *         else
-     *             result = accumulator.apply(result, element);
+     *             result = accumulator.applyAsLong(result, element);
      *     }
      *     return foundAny ? OptionalLong.of(result) : OptionalLong.empty();
      * }</pre>