RFR(XS): JDK-8048989 small errors in Collectors examples (original) (raw)
Stuart Marks stuart.marks at oracle.com
Wed Jul 2 00:34:56 UTC 2014
- Previous message: RFR: 8047722: @since tag cleanup in corba
- Next message: RFR(XS): JDK-8048989 small errors in Collectors examples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Please review this small patch to fix some errors in the examples in the docs for java.util.stream.Collectors. Thanks to Raoul Urma for pointing these out.
s'marks
HG changeset patch
User smarks
Date 1404256293 25200
Tue Jul 01 16:11:33 2014 -0700
Node ID 5b6a12d8a26e96052bc1c3ff787e8836fa4d64da
Parent 71012e1b8534c481ba42a38e77fca0b90299628d
8048989: small errors in Collectors examples Reviewed-by: XXX Contributed-by: raoul at urma.com
diff -r 71012e1b8534 -r 5b6a12d8a26e src/share/classes/java/util/stream/Collectors.java --- a/src/share/classes/java/util/stream/Collectors.java Mon Jun 16 17:52:21 2014 -0700 +++ b/src/share/classes/java/util/stream/Collectors.java Tue Jul 01 16:11:33 2014 -0700 @@ -729,7 +729,7 @@ * person in each city: *
{@code * Comparator byHeight = Comparator.comparing(Person::getHeight);
* Map<City, Person> tallestByCity
* Map<City, Optional<Person>> tallestByCity * = people.stream().collect(groupingBy(Person::getCity,
reducing(BinaryOperator.maxBy(byHeight)))); * }
* @@ -784,7 +784,7 @@ * Comparator byLength = Comparator.comparing(String::length); * Map<City, String> longestLastNameByCity * = people.stream().collect(groupingBy(Person::getCity,*
reducing(Person::getLastName, BinaryOperator.maxBy(byLength))));
* reducing("",
Person::getLastName, BinaryOperator.maxBy(byLength)))); * } * * @param the type of the input elements
- Previous message: RFR: 8047722: @since tag cleanup in corba
- Next message: RFR(XS): JDK-8048989 small errors in Collectors examples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]