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

java/util/Formatter/Basic.java failed in tr locale

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Clarification regarding the Locale used for upper casing if an uppercase conversion is used

      Problem

      Formatter API specification description is misleading about the Locale used for upper casing the resulting string. According to the spec description, the result is equivalent to the following invocation of String.toUpperCase(Locale)

      out.toUpperCase(Locale.getDefault(Locale.Category.FORMAT))

      which means that the default locale is used always for upper casing

      Solution

      The API specification should clarify that the prevailing locale is used for upper casing and if no locale is specified during the instance creation and/or through a method call, then the default locale is used.

      Specification

      Changing Formatter API spec (2 Occurrences)

      from:

       * denoted by an upper-case character (i.e. {@code 'B'}, {@code 'H'},
       * {@code 'S'}, {@code 'C'}, {@code 'X'}, {@code 'E'}, {@code 'G'},
       * {@code 'A'}, and {@code 'T'}) are the same as those for the corresponding
       * lower-case conversion characters except that the result is converted to
       * upper case according to the rules of the prevailing {@link java.util.Locale
       * Locale}.  The result is equivalent to the following invocation of {@link
       * String#toUpperCase(Locale)}
       *
       * <pre>
       *    out.toUpperCase(Locale.getDefault(Locale.Category.FORMAT)) </pre>

      to:

       * denoted by an upper-case character (i.e. {@code 'B'}, {@code 'H'},
       * {@code 'S'}, {@code 'C'}, {@code 'X'}, {@code 'E'}, {@code 'G'},
       * {@code 'A'}, and {@code 'T'}) are the same as those for the corresponding
       * lower-case conversion characters except that the result is converted to
       * upper case according to the rules of the prevailing {@link java.util.Locale
       * Locale}. If there is no explicit locale specified, either at the
       * construction of the instance or as a parameter to its method
       * invocation, then the {@link java.util.Locale.Category#FORMAT default locale}
       * is used.
       *

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nishjain Nishit Jain
                Reporter:
                mimizhou Ming Zhou (Inactive)
                Reviewed By:
                Naoto Sato
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: