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

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

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 14
    • core-libs
    • None
    • minimal

      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/

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

              Created:
              Updated:
              Resolved: