8029944: Primitive Stream reduce method documentation pseudo code misidentifies apply method
authormichaelm
Wed, 11 Dec 2013 15:26:47 -0800
changeset 22996 0ce70f4ef909
parent 22995 453241790793
child 22998 e60a93872ff7
8029944: Primitive Stream reduce method documentation pseudo code misidentifies apply method Reviewed-by: mduigou Contributed-by: michael.mcmahon@oracle.com
jdk/src/share/classes/java/util/stream/DoubleStream.java
jdk/src/share/classes/java/util/stream/IntStream.java
jdk/src/share/classes/java/util/stream/LongStream.java
--- a/jdk/src/share/classes/java/util/stream/DoubleStream.java	Thu Feb 20 13:03:36 2014 +0000
+++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java	Wed Dec 11 15:26:47 2013 -0800
@@ -330,7 +330,7 @@
      * <pre>{@code
      *     double result = identity;
      *     for (double element : this stream)
-     *         result = accumulator.apply(result, element)
+     *         result = accumulator.applyAsDouble(result, element)
      *     return result;
      * }</pre>
      *
@@ -391,7 +391,7 @@
      *             result = element;
      *         }
      *         else
-     *             result = accumulator.apply(result, element);
+     *             result = accumulator.applyAsDouble(result, element);
      *     }
      *     return foundAny ? OptionalDouble.of(result) : OptionalDouble.empty();
      * }</pre>
--- a/jdk/src/share/classes/java/util/stream/IntStream.java	Thu Feb 20 13:03:36 2014 +0000
+++ b/jdk/src/share/classes/java/util/stream/IntStream.java	Wed Dec 11 15:26:47 2013 -0800
@@ -323,7 +323,7 @@
      * <pre>{@code
      *     int result = identity;
      *     for (int element : this stream)
-     *         result = accumulator.apply(result, element)
+     *         result = accumulator.applyAsInt(result, element)
      *     return result;
      * }</pre>
      *
@@ -384,7 +384,7 @@
      *             result = element;
      *         }
      *         else
-     *             result = accumulator.apply(result, element);
+     *             result = accumulator.applyAsInt(result, element);
      *     }
      *     return foundAny ? OptionalInt.of(result) : OptionalInt.empty();
      * }</pre>
--- a/jdk/src/share/classes/java/util/stream/LongStream.java	Thu Feb 20 13:03:36 2014 +0000
+++ b/jdk/src/share/classes/java/util/stream/LongStream.java	Wed Dec 11 15:26:47 2013 -0800
@@ -328,7 +328,7 @@
      * <pre>{@code
      *     long result = identity;
      *     for (long element : this stream)
-     *         result = accumulator.apply(result, element)
+     *         result = accumulator.applyAsLong(result, element)
      *     return result;
      * }</pre>
      *
@@ -389,7 +389,7 @@
      *             result = element;
      *         }
      *         else
-     *             result = accumulator.apply(result, element);
+     *             result = accumulator.applyAsLong(result, element);
      *     }
      *     return foundAny ? OptionalLong.of(result) : OptionalLong.empty();
      * }</pre>