# HG changeset patch # User smarks # Date 1404283171 25200 # Node ID 4d6cbcbcc4379f150a43906b78e7af54c61b283f # Parent 2d687ea8608abf28e94d8d312b83bc4e22851d6f 8048989: small errors in Collectors examples Reviewed-by: darcy Contributed-by: raoul@urma.com diff -r 2d687ea8608a -r 4d6cbcbcc437 jdk/src/share/classes/java/util/stream/Collectors.java --- a/jdk/src/share/classes/java/util/stream/Collectors.java Tue Jul 01 21:23:54 2014 +0200 +++ b/jdk/src/share/classes/java/util/stream/Collectors.java Tue Jul 01 23:39:31 2014 -0700 @@ -729,7 +729,7 @@ * person in each city: *
{@code
      *     Comparator byHeight = Comparator.comparing(Person::getHeight);
-     *     Map tallestByCity
+     *     Map> tallestByCity
      *         = people.stream().collect(groupingBy(Person::getCity, reducing(BinaryOperator.maxBy(byHeight))));
      * }
* @@ -784,7 +784,7 @@ * Comparator byLength = Comparator.comparing(String::length); * Map 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