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

Specifications for <primitiveType>Value methods should be clarified

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.4.1
    • 1.4.1
    • core-libs
    • None
    • hopper
    • generic
    • generic
    • Verified

      The JavaDoc for the intValue, longValue, floatValue, and doubleValue methods in the BigInteger and BigDecimal classes slightly mistates the relation of these methods to Java language narrowing primitive conversions. In particular, technically speaking these methods don't implement narrowing primitive conversions since the "big" types aren't primitive. Also some of the conversion methods can lose more information than others; e.g. BigDecimal.intValue can lose, magnitude, precision, and *sign* information while BigDecimal.doubleValue can only lose magnitude and precision information. These issues should be clarified in the JavaDoc descriptions.

            darcy Joe Darcy
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: