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

Wrong display name for supplemental Japanese era

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      9
    • Resolved In Build:
      b155
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        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."

          Issue Links

            Activity

            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/e0ab92b7360f
            User: naoto
            Date: 2017-01-31 21:29:42 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/e0ab92b7360f User: naoto Date: 2017-01-31 21:29:42 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/e0ab92b7360f
            User: lana
            Date: 2017-02-01 21:14:30 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/e0ab92b7360f User: lana Date: 2017-02-01 21:14:30 +0000

              People

              • Assignee:
                naoto Naoto Sato
                Reporter:
                naoto Naoto Sato
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: