Forum Stats

  • 3,837,375 Users
  • 2,262,252 Discussions
  • 7,900,266 Comments

Discussions

jdk8 stream doc bug

location:

"java.util.stream.Collectors#toMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>)",

there is bug in the doc of this jdk method,

origin:

"* Map<String, Student> studentIdToStudent
* students.stream().collect(toMap(Student::getId,
* Functions.identity());",

correct use:

"* Map<String, Student> studentIdToStudent
* students.stream().collect(toMap(Student::getId,
* Function.identity());"

This discussion has been closed.