OpenJDK / portola / portola
changeset 25224:7c7e029826e1
8043327: Collectors.toMap studentToGPA example uses Functions.identity()
8043328: Typo in documentation of package java.util.stream
Reviewed-by: alanb, lancea
author | psandoz |
---|---|
date | Thu, 03 Jul 2014 09:30:25 +0200 |
parents | 4d33af5975a5 |
children | f161e8748e8d |
files | jdk/src/share/classes/java/util/stream/Collectors.java jdk/src/share/classes/java/util/stream/package-info.java |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/share/classes/java/util/stream/Collectors.java Wed Jul 02 14:14:17 2014 -0700 +++ b/jdk/src/share/classes/java/util/stream/Collectors.java Thu Jul 03 09:30:25 2014 +0200 @@ -1220,7 +1220,7 @@ * students to their grade point average: * <pre>{@code * Map<Student, Double> studentToGPA - * students.stream().collect(toMap(Functions.identity(), + * students.stream().collect(toMap(Function.identity(), * student -> computeGPA(student))); * }</pre> * And the following produces a {@code Map} mapping a unique identifier to @@ -1228,7 +1228,7 @@ * <pre>{@code * Map<String, Student> studentIdToStudent * students.stream().collect(toMap(Student::getId, - * Functions.identity()); + * Function.identity()); * }</pre> * * @implNote @@ -1390,7 +1390,7 @@ * students to their grade point average: * <pre>{@code * Map<Student, Double> studentToGPA - * students.stream().collect(toMap(Functions.identity(), + * students.stream().collect(toMap(Function.identity(), * student -> computeGPA(student))); * }</pre> * And the following produces a {@code Map} mapping a unique identifier to @@ -1398,7 +1398,7 @@ * <pre>{@code * Map<String, Student> studentIdToStudent * students.stream().collect(toConcurrentMap(Student::getId, - * Functions.identity()); + * Function.identity()); * }</pre> * * <p>This is a {@link Collector.Characteristics#CONCURRENT concurrent} and
--- a/jdk/src/share/classes/java/util/stream/package-info.java Wed Jul 02 14:14:17 2014 -0700 +++ b/jdk/src/share/classes/java/util/stream/package-info.java Thu Jul 03 09:30:25 2014 +0200 @@ -468,7 +468,7 @@ * <pre>{@code * int sumOfWeights = widgets.stream() * .reduce(0, - * (sum, b) -> sum + b.getWeight()) + * (sum, b) -> sum + b.getWeight(), * Integer::sum); * }</pre> * though the explicit map-reduce form is more readable and therefore should