Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8326908 DecimalFormat::toPattern throws OutOfMemoryError when pattern is empty string
  3. JDK-8327164

Release Note: java.text.DecimalFormat Change of the Default Maximum Fraction Digits for the Empty Pattern

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      For a `java.text.DecimalFormat` created with an empty String pattern, the value returned by `DecimalFormat.getMaximumFractionDigits()` will now be 340, instead of the previous value, `Integer.MAX_VALUE`. This prevents an `OutOfMemoryError` from occurring when `DecimalFormat.toPattern()` is called. If the desired maximum fractional digits should exceed 340, it is recommended to achieve this behavior using the method `DecimalFormat.setMaximumFractionDigits()`.

      Attachments

        Activity

          People

            jlu Justin Lu
            jlu Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: