RFR 8043328 and 8043327: errors in stream docs (original) (raw)
Lance Andersen lance.andersen at oracle.com
Wed Jul 2 10:09:58 UTC 2014
- Previous message: RFR 8043328 and 8043327: errors in stream docs
- Next message: RFR 8043328 and 8043327: errors in stream docs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
+1 On Jul 2, 2014, at 4:25 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
Hi,
Stuarts recent doc fix from Raoul reminded me about a few others: https://bugs.openjdk.java.net/browse/JDK-8043328 Typo in documentation of package java.util.stream https://bugs.openjdk.java.net/browse/JDK-8043327 Collectors.toMap studentToGPA example uses Functions.identity() See below for patch. Stuart, are you planning to back port your doc fix to 8u-dev? If so we could do all three in one go. Paul. diff -r 4623ea09772f src/share/classes/java/util/stream/Collectors.java --- a/src/share/classes/java/util/stream/Collectors.java Wed Jul 02 08:41:59 2014 +0200 +++ b/src/share/classes/java/util/stream/Collectors.java Wed Jul 02 10:23:57 2014 +0200 @@ -1220,7 +1220,7 @@ * students to their grade point average: *
{@code* Map studentToGPA - * students.stream().collect(toMap(Functions.identity(), + * students.stream().collect(toMap(Function.identity(), * student -> computeGPA(student))); * } * And the following produces a {@code Map} mapping a unique identifier to @@ -1228,7 +1228,7 @@ *{@code* Map studentIdToStudent * students.stream().collect(toMap(Student::getId, - * Functions.identity()); + * Function.identity()); * } * * @implNote @@ -1390,7 +1390,7 @@ * students to their grade point average: *{@code* Map studentToGPA - * students.stream().collect(toMap(Functions.identity(), + * students.stream().collect(toMap(Function.identity(), * student -> computeGPA(student))); * } * And the following produces a {@code Map} mapping a unique identifier to @@ -1398,7 +1398,7 @@ *{@code* Map studentIdToStudent * students.stream().collect(toConcurrentMap(Student::getId, - * Functions.identity()); + * Function.identity()); * } * *This is a {@link Collector.Characteristics#CONCURRENT concurrent} and
diff -r 4623ea09772f src/share/classes/java/util/stream/package-info.java --- a/src/share/classes/java/util/stream/package-info.java Wed Jul 02 08:41:59 2014 +0200 +++ b/src/share/classes/java/util/stream/package-info.java Wed Jul 02 10:23:57 2014 +0200 @@ -468,7 +468,7 @@ *{@code* int sumOfWeights = widgets.stream() * .reduce(0, - * (sum, b) -> sum + b.getWeight()) + * (sum, b) -> sum + b.getWeight(), * Integer::sum); * } * though the explicit map-reduce form is more readable and therefore should
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com
- Previous message: RFR 8043328 and 8043327: errors in stream docs
- Next message: RFR 8043328 and 8043327: errors in stream docs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]