8028516: Java doc error in Int/Long/Double/Stream.peek
authorpsandoz
Mon, 25 Nov 2013 09:55:34 +0100
changeset 21846 c10feb34bc0b
parent 21845 35695321f5a5
child 21847 8d279ff7e53e
8028516: Java doc error in Int/Long/Double/Stream.peek Reviewed-by: chegar
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
jdk/src/share/classes/java/util/stream/Stream.java
--- a/jdk/src/share/classes/java/util/stream/DoubleStream.java	Fri Nov 22 11:34:26 2013 +0100
+++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java	Mon Nov 25 09:55:34 2013 +0100
@@ -207,12 +207,12 @@
      * @apiNote This method exists mainly to support debugging, where you want
      * to see the elements as they flow past a certain point in a pipeline:
      * <pre>{@code
-     *     list.stream()
-     *         .filter(filteringFunction)
-     *         .peek(e -> System.out.println("Filtered value: " + e));
-     *         .map(mappingFunction)
-     *         .peek(e -> System.out.println("Mapped value: " + e));
-     *         .collect(Collectors.toDoubleSummaryStastistics());
+     *     DoubleStream.of(1, 2, 3, 4)
+     *         .filter(e -> e > 2)
+     *         .peek(e -> System.out.println("Filtered value: " + e))
+     *         .map(e -> e * e)
+     *         .peek(e -> System.out.println("Mapped value: " + e))
+     *         .sum();
      * }</pre>
      *
      * @param action a <a href="package-summary.html#NonInterference">
--- a/jdk/src/share/classes/java/util/stream/IntStream.java	Fri Nov 22 11:34:26 2013 +0100
+++ b/jdk/src/share/classes/java/util/stream/IntStream.java	Mon Nov 25 09:55:34 2013 +0100
@@ -200,12 +200,12 @@
      * @apiNote This method exists mainly to support debugging, where you want
      * to see the elements as they flow past a certain point in a pipeline:
      * <pre>{@code
-     *     list.stream()
-     *         .filter(filteringFunction)
-     *         .peek(e -> System.out.println("Filtered value: " + e));
-     *         .map(mappingFunction)
-     *         .peek(e -> System.out.println("Mapped value: " + e));
-     *         .collect(Collectors.toIntSummaryStastistics());
+     *     IntStream.of(1, 2, 3, 4)
+     *         .filter(e -> e > 2)
+     *         .peek(e -> System.out.println("Filtered value: " + e))
+     *         .map(e -> e * e)
+     *         .peek(e -> System.out.println("Mapped value: " + e))
+     *         .sum();
      * }</pre>
      *
      * @param action a <a href="package-summary.html#NonInterference">
--- a/jdk/src/share/classes/java/util/stream/LongStream.java	Fri Nov 22 11:34:26 2013 +0100
+++ b/jdk/src/share/classes/java/util/stream/LongStream.java	Mon Nov 25 09:55:34 2013 +0100
@@ -205,12 +205,12 @@
      * @apiNote This method exists mainly to support debugging, where you want
      * to see the elements as they flow past a certain point in a pipeline:
      * <pre>{@code
-     *     list.stream()
-     *         .filter(filteringFunction)
-     *         .peek(e -> System.out.println("Filtered value: " + e));
-     *         .map(mappingFunction)
-     *         .peek(e -> System.out.println("Mapped value: " + e));
-     *         .collect(Collectors.toLongSummaryStastistics());
+     *     LongStream.of(1, 2, 3, 4)
+     *         .filter(e -> e > 2)
+     *         .peek(e -> System.out.println("Filtered value: " + e))
+     *         .map(e -> e * e)
+     *         .peek(e -> System.out.println("Mapped value: " + e))
+     *         .sum();
      * }</pre>
      *
      * @param action a <a href="package-summary.html#NonInterference">
--- a/jdk/src/share/classes/java/util/stream/Stream.java	Fri Nov 22 11:34:26 2013 +0100
+++ b/jdk/src/share/classes/java/util/stream/Stream.java	Mon Nov 25 09:55:34 2013 +0100
@@ -403,12 +403,12 @@
      * @apiNote This method exists mainly to support debugging, where you want
      * to see the elements as they flow past a certain point in a pipeline:
      * <pre>{@code
-     *     list.stream()
-     *         .filter(filteringFunction)
-     *         .peek(e -> System.out.println("Filtered value: " + e));
-     *         .map(mappingFunction)
-     *         .peek(e -> System.out.println("Mapped value: " + e));
-     *         .collect(Collectors.intoList());
+     *     Stream.of("one", "two", "three", "four")
+     *         .filter(e -> e.length() > 3)
+     *         .peek(e -> System.out.println("Filtered value: " + e))
+     *         .map(String::toUpperCase)
+     *         .peek(e -> System.out.println("Mapped value: " + e))
+     *         .collect(Collectors.toList());
      * }</pre>
      *
      * @param action a <a href="package-summary.html#NonInterference">