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

Error in Collectors.averagingXXX Java Doc

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b159
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Backports

        Description

        A DESCRIPTION OF THE PROBLEM :
        Java Doc for Collectors.averagingInt states the following:
        ***************
        Returns:
        a Collector that produces the sum of a derived property
        ***************
        But it returns "arithmetic mean of an integer-valued function applied to the input elements"
        The same issue for averagingLong and averagingDouble

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Returns:
        a Collector that produces the arithmetic mean of an integer-valued function applied to the input elements
        ACTUAL -
        Returns:
        a Collector that produces the sum of a derived property

        URL OF FAULTY DOCUMENTATION :
        https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#averagingInt-java.util.function.ToIntFunction-

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: