JDK-8244555 : Release Note: localizedBy() Overrides Localized Values With Default Values
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 15
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • OS: generic
  • CPU: generic
  • Submitted: 2020-05-06
  • Updated: 2021-05-14
  • Resolved: 2020-08-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15Resolved
Description
`java.time.format.DateTimeFormatter.localizedBy(Locale)` method now honors the default locale values, such as `Chronology`and/or `DecimalStyle` of the specified locale argument. 

For example, in previous JDK releases:
```
jshell> DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
    .localizedBy(Locale.forLanguageTag("fa"))
    .format(LocalDate.now())
$3 ==> "�������� 1 ������ 2020"
```
the numbers are in Arabic (Western) numerals.
 
In JDK 15:
```
jshell> DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
    .localizedBy(Locale.forLanguageTag("fa"))
    .format(LocalDate.now())
$3 ==> "�������� �� ������ ��������"
```
the numbers are in Extended Arabic-Indic numerals because it is the default numbering system for the Farsi locale.