JDK-8000964 : Calendar [zh_CN]: Locale falls back to CLDR adapter first when -Djava.locale.providers=JRE,CLDR
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • Submitted: 2012-10-16
  • Updated: 2017-08-09
  • Resolved: 2017-08-09
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.
8 b66Resolved
Related Reports
Relates :  
Run the attached test program, CalendarTest.java. The program tries to load the SHORT_STANDALONE display name of weekday. 

When adapter list is JRE,CLDR, the short display name in CLDR is loaded. I check the resource files in JDK. Format_zh_CN.class and Format_zh.class are in JRE resources. In CLDR resource, there is only Format_zh.class. There is also no standalone.DayAbbreviations in all these files. The expected output should be from JRE adapter, when adapter list is JRE,CLDR.

This problem only happens in zh_CN. In other locales I checked (en_US, de_DE and ja_JP), the short display name is loaded from resource file in JRE when adapter list is JRE,CLDR. Attached is the screenshot of the output. 
This issue has been addressed with JDK-8000986 in JDK8. Not able to reproduce this on JDK8 with "-Djava.locale.providers" = JRE,CLDR

SPI division of Data/Name has already been done. Please check if this is still an issue.

This needs to be addressed in JDK 8.

Currently CalendarDataProvider provides SPIs for both calendar related data, such as "first day in week", and calendar field localized names. This makes it difficult for fine grained provider selection. In this case, JRE's CalendarDataProvider implementation returns supported locales with the existence of CalendarData_xx.properties where "zh_CN" is not available, yet the localized names for "zh_CN" is available with FormatData_zh_CN. This is why CLDR's localized names are retrieved. To correct this situation, dividing CalendarDataProvider into two SPIs would solve it, e.g., CalendarDataProvider and CalendarNameProvider.