JDK-8220020 : java.util.Calendar.getDisplayName returns era name in English instead of Japanese name for style=LONG and Locale=JAPAN for CLDR as locale providers.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 8-pool
  • Priority: P3
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • Submitted: 2019-03-03
  • Updated: 2019-08-01
  • Resolved: 2019-08-01
Related Reports
Relates :  
Description
java.util.Calendar.getDisplayName(int field, int style, Locale locale) returns era name in English instead of Japanese name. Below are the steps to reproduce the issue:-

Set JVM parameter java.locale.providers=CLDR

Calendar c = new Calendar.Builder()
            .setCalendarType("japanese")
            .setFields(ERA, 4, YEAR, 1, MONTH, MAY, DAY_OF_MONTH, 1)
            .build();

String eraName = c.getDisplayName(ERA, LONG, Locale.Japan);

Actual Result :- The value of eraName is "Heise"

Expected Result:- The value of eraName should be "������"


Root Cause of issue:-

The cause of issue is that CLDR java resource file (FormatData_ja.java) generated by "CLDR Converter" does not contain required resource key "japanese.long.Eras".  The "CLDR Converter" need to be fixed to address this issue. 
Comments
Cannot reproduce with JDK14 code base. A lot of CLDR code has changed since JDK8 and this must be fixed along them. Unless some customer claims this should be fixed in JDK8, I would not expect it to be backported to JDK8.
01-08-2019