JDK-8212942 : Loosen the range of JapaneseEra
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.time
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 12
  • Submitted: 2018-10-24
  • Updated: 2019-01-08
  • Resolved: 2018-10-30
Related Reports
CSR :  
Relates :  

In order to accommodate the future addition of JapaneseEra without spec changes, loosening the current JapaneseEra spec would be desired.


The current spec does not mention available eras returned from of()/valueOf()/values() methods, especially it is unclear if a new era is declared by the Japanese government. This would be more problematic for the maintenance releases.


Specify the possible values returned from those static methods, and their parameters.


Add the following sentence in the class description:

    * The number of the valid eras may increase, as new eras may be
    * defined by the Japanese government. Once an era is defined,
    * subsequent versions of this class will add a singleton instance
    * for it. The defined era is expected to have a consecutive integer
    * associated with it.

Add the following paragraph to of(int) method description:

     * <p>
     * In addition to the known era singletons, values for additional
     * eras may be defined. Those values are the {@link Era#getValue()}
     * of corresponding eras from the {@link #values()} method.

Add the following paragraph to valueOf(String) method description:

     * <p>
     * Valid era names are the names of eras returned from {@link #values()}.

Change the first paragraph of values() method from:

    * Returns an array of JapaneseEras.


     * Returns an array of JapaneseEras. The array may contain eras defined
     * by the Japanese government beyond the known era singletons.

Moving to Approved.

I appended two sentences to the class description per your suggestion.

Naoto, I've changed the CSR to be in Proposed state and I'm moving it to Provisional. Please update with the final expected text once that goes through code review and Finalize the request.