JDK-8218207 : Replace the placeholder Japanese era name
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 13
  • Submitted: 2019-02-01
  • Updated: 2019-04-01
  • Resolved: 2019-04-01
Related Reports
CSR :  
Description
Summary
-------

Replace the placeholder name for the Japanese new era with the government declared name.

Problem
-------

The era name, "NewEra", was introduced with JDK-8202336 as the placeholder. However, the placeholder name does not represent "Reiwa".

Solution
--------

Replace each instance of "NewEra" and its localized names made in [JDK-8202336][1] and its square character ([JDK-8211739][2]) with the government declared name. Namely,

**java.time.chrono.JapaneseEra:**

The name of the JapaneseEra singleton that has the value of '3' will change from "NewEra" to "Reiwa". Thus,

- `JapaneseEra.values()` method will return 5 eras: [MEIJI, TAISHO, SHOWA, HEISEI, *singleton representing "Reiwa"*], the 5th item being changed from the one for "NewEra"
- `JapaneseEra.of(3)`,  `JapaneseEra.valueOf("Reiwa")`, and `JapaneseChronology.eraOf(3)` will return the singleton era that represents "Reiwa"
- `JapaneseEra.getDisplayName()` for the new era instance will return the localized display name of "Reiwa"
- `JapaneseEra.valueOf("NewEra")` will throw an IllegalArgumentException
 
**java.util.Calendar:**

The name of the era in `JapaneseImperialCalendar` that has the value of '5' will change from "NewEra" to "Reiwa". 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 "Reiwa"

**java.lang.Character:**

The return value from `Character.getName(0x32FF)` will change from "SQUARE ERA NAME NEWERA" to "SQUARE ERA NAME REIWA".

Specification
-------------

This is behavioral change only and no spec change is expected. As to `JapaneseEra` changes, the *era names* are not part of their specifications, so changing the placeholder name to "Reiwa" does not warrant the specification changes.

  [1]: https://bugs.openjdk.java.net/browse/JDK-8202336
  [2]: https://bugs.openjdk.java.net/browse/JDK-8211739
Comments
Moving to Approved.
01-04-2019

Moving to Provisional.
19-03-2019