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

Access required for java.text.DecimalFormatSymbol.locale

    XMLWordPrintable

Details

    • CSR
    • Status: Closed
    • P3
    • Resolution: Approved
    • 19
    • core-libs
    • None
    • source
    • minimal
    • Adding access to existing field. The locale is a benign value, and would have been required to retrieve the DecimalFormatSymbol originally.
    • Java API
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: