Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8212942

Loosen the range of JapaneseEra

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 12
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Adding new Eras should have no impact on existing applications.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

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

      Problem

      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.

      Solution

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

      Specification

      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.

      to:

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naoto Naoto Sato
                Reporter:
                naoto Naoto Sato
                Reviewed By:
                Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: