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

Javadoc of Int/Long/DoubleSummaryStatistics should mention possible overflow of count

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal

      Description

      Summary

      The javadoc of the classes IntSummaryStatistics, LongSummaryStatistics, and DoubleSummaryStatistics should mention possible overflow of count.

      Problem

      Javadoc of classes IntSummaryStatistics and LongSummaryStatistics specify that their implementation does not check for overflow of the sum. Documentation does not mention handling overflow of the count. This can give an impression that the implementation treats the count differently, that is checks possibility of overflow.

      Solution

      @implNote section of the javadoc of classes IntSummaryStatistics and LongSummaryStatistics needs to be updated to explicitly state that the count is not checked for overflow. A similar update needs to be done for the javadoc of the class DoubleSummaryStatistics.

      Specification

      The documentation for the classes IntSummaryStatistics and LongSummaryStatistics will be edited as following:

      - * <p>This implementation does not check for overflow of the sum.
      + * <p>This implementation does not check for overflow of the count or the sum.

      The documentation for the class DoubleSummaryStatistics will have the following additon:

      + * <p>This implementation does not check for overflow of the count.

      The complete change is found in the webrev: http://cr.openjdk.java.net/~igerasim/8224716/00/webrev/

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              igerasim Ivan Gerasimov
              Reporter:
              igerasim Ivan Gerasimov
              Reviewed By:
              Brian Burkhalter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: