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

Error in Collectors.averagingXXX Java Doc

XMLWordPrintable

    • b159
    • generic
    • generic
    • Not verified

        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-

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

                Created:
                Updated:
                Resolved: