Incorrect documentation on Collectors.toMap

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 8u45
    • Component/s: core-libs

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      The documentation makes reference to "Functions" when it should be "Function".


         * @apiNote
           * It is common for either the key or the value to be the input elements.
           * In this case, the utility method
           * {@link java.util.function.Function#identity()} may be helpful.
           * For example, the following produces a {@code Map} mapping
           * students to their grade point average:
           * <pre>{@code
           * Map<Student, Double> studentToGPA
           * students.stream().collect(toMap(Functions.identity(),
           * student -> computeGPA(student)));
           * }</pre>
           * And the following produces a {@code Map} mapping a unique identifier to
           * students:
           * <pre>{@code
           * Map<String, Student> studentIdToStudent
           * students.stream().collect(toMap(Student::getId,
           * Functions.identity());
           * }</pre>
           *


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Assignee:
            Paul Sandoz
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: