Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8028516

Java doc error in Int/Long/Double/Stream.peek

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • None
    • core-libs

    Description

      The code snippet in the Java doc of Stream.peek is incorrect:

           * <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());
           * }</pre>

      it should be "Collectors.toList());"

      There are similar errors on the same method for primitive streams

      Attachments

        Activity

          People

            psandoz Paul Sandoz
            psandoz Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: