-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
Java API
-
SE
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.
*
- csr of
-
JDK-8060094 java/util/Formatter/Basic.java failed in tr locale
-
- Closed
-