-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: None
-
Component/s: core-libs
-
b119
-
Verified
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
* <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