A DESCRIPTION OF THE PROBLEM :
Guava's Functions class is mentioned in 4 examples while in Java SE 8, the name of the utility class is without an ending "s" (Function.identity()).
https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#toMap-java.util.function.Function-java.util.function.Function-
https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#toConcurrentMap-java.util.function.Function-java.util.function.Function-
While fixing that part of the javadoc, it would be better to put an equal "=" to assign the values in the examples of this class, like here:
Map<Student, Double> studentToGPA =
students.stream().collect(toMap(Functions.identity(),
student -> computeGPA(student)));
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#toMap-java.util.function.Function-java.util.function.Function-
Guava's Functions class is mentioned in 4 examples while in Java SE 8, the name of the utility class is without an ending "s" (Function.identity()).
https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#toMap-java.util.function.Function-java.util.function.Function-
https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#toConcurrentMap-java.util.function.Function-java.util.function.Function-
While fixing that part of the javadoc, it would be better to put an equal "=" to assign the values in the examples of this class, like here:
Map<Student, Double> studentToGPA =
students.stream().collect(toMap(Functions.identity(),
student -> computeGPA(student)));
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#toMap-java.util.function.Function-java.util.function.Function-
- duplicates
-
JDK-8043327 Collectors.toMap studentToGPA example uses Functions.identity()
-
- Closed
-