-
CSR
-
Resolution: Approved
-
P3
-
None
-
behavioral
-
low
-
-
Java API
-
SE
Summary
It is imperative to have the Japanese new era implemented in the JDK prior to its start date (May 1st, 2019).
Problem
It is anticipated that the announcement of the name of the new era may not be ready for the last JDK update before the beginning of the new era.
Solution
Implement the new era with a placeholder name "NewEra" (default) and 新元号 (in Japanese), so that the "year of era" value should be correctly calculated. The placeholder should be replaced with the genuine name after it is announced (with JDK-8174268)
Specification
java.time.chrono.JapaneseEra:
The field description of HEISEI changes from:
The singleton instance for the 'Heisei' era (1989-01-08 - current)
to:
The singleton instance for the 'Heisei' era (1989-01-08 - 2019-04-30)
"NewEra" singleton, which starts from 2019-05-01 and has the value of '3', will be defined in JapaneseEra class and be used:
- values() method will return 5 eras: [Meiji, Taisho, Showa, Heisei, NewEra]
- JapaneseEra.of(3) will return a singleton era that represents "NewEra"
java.util.Calendar:
JapaneseImperialCalendar will have the new era that has the value of '5'. Thus,
new Calendar.Builder()
.setCalendarType("japanese")
.setFields(Calendar.ERA, 5,
Calendar.YEAR, 1,
Calendar.MONTH, Calendar.MAY,
Calendar.DAY_OF_MONTH, 1)
.build()
.getDisplayName(Calendar.ERA, Calendar.LONG, Locale.US)
returns "NewEra"
- csr of
-
JDK-8202088 Japanese new era implementation
- Resolved