Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8062251

Collectors.toMap documentation makes reference to incorrect class name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u25
    • core-libs

      A DESCRIPTION OF THE PROBLEM :
      The documentation makes repeated reference to "Functions.identity()" in code samples, e.g.:

           Map<Student, Double> studentToGPA
               students.stream().collect(toMap(Functions.identity(),
                                               student -> computeGPA(student)));
       
      Such a class does not exist. It should read "Function.identity()".


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Function.identity()
      ACTUAL -
      Functions.identity()

      URL OF FAULTY DOCUMENTATION :
      http://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html

            psandoz Paul Sandoz
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: