JDK-8173423 : Wrong display name for supplemental Japanese era
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2017-01-26
  • Updated: 2017-11-29
  • Resolved: 2017-01-31
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 10 JDK 8 JDK 9
10Fixed 8u152Fixed 9 b155Fixed
Related Reports
Relates :  
Relates :  
Description
If a supplemental new era is specified with the system property "jdk.calendar.japanese.supplemental.era", the display name is incorrect in the formatted string. The following code snippet demonstrates the issue (" -Djdk.calendar.japanese.supplemental.era="name=NewEra,abbr=N.E.,since=1546300800000"" is given on invocation):

--
                LocalDate ldHeisei = LocalDate.of(2018, Month.JANUARY, 1);
                LocalDate ldNewEra = LocalDate.of(2019, Month.JANUARY, 1); // first day of NewEra
                DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
                        .withChronology(JapaneseChronology.INSTANCE)
                        .withZone(ZoneId.systemDefault());
                System.out.println(dtf.format(ldHeisei));
                System.out.println(dtf.format(ldNewEra));
--

The output is:

--
Monday, January 1, 30 Heisei
Tuesday, January 1, 1 3
--

The last "3" should display as "NewEra."