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

Access required for java.text.DecimalFormatSymbol.locale

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 19
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Adding access to existing field. The locale is a benign value, and would have been required to retrieve the DecimalFormatSymbol originally.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Provide public access to DecimalFormatSymbol's locale to improve caching of DecimalFormatSymbols in java.util.Formatter.

      Problem

      Formatting of numerics in java.util.Formatter takes a significant performance hit due an expensive retrieval (requires a new instance) of the locale's DecimalFormatSymbol anytime a locale may have changed.

      Solution

      The retrieval of the DecimalFormatSymbol can be skipped if java.util.Formatter can quickly determine that a cached DecimalFormatSymbol is valid for the current locale. This can be achieved by providing a public accessor to DecimalFormatSymbol.locale.

      Specification

      +    /**
      +     * {@return locale used to create this instance}
      +     *
      +     * @since 19
      +     */
      +    public Locale getLocale() {
      +        return locale;
      +    }
      +

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlaskey Jim Laskey
              Reporter:
              jlaskey Jim Laskey
              Reviewed By:
              Naoto Sato, Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: