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

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

XMLWordPrintable

    • generic
    • generic

      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()`.

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

              Created:
              Updated:
              Resolved: