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

HOST locale provider holds wrong era name for GregorianCalendar in US locale

    XMLWordPrintable

Details

    • b08
    • generic
    • windows

    Backports

      Description

        On JDK 11 when using the host locale provider with GregorianCalendar,
        the display name of era got from Calendar.getDIsplayNames() is "A.D." on Windows,
        which should "AD". Meanwhile, the correct display name can be obtained when
        getting it from Calendar.getDisplayName(). The issue is reproducible with
        the JDK 14 and a backport is needed to JDK 11.

        $ ${JDK11}/java -showversion -Djava.locale.providers=HOST Sample3
        java version "11.0.2" 2019-01-15 LTS
        Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
        Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
        SHORT_FORMAT ERA by getDisplayName:AD
        SHORT_FORMAT ERA by getDisplayNames:{BC=0, A.D.=1}

        $ ${JDK11}/java -showversion Sample3
        java version "11.0.2" 2019-01-15 LTS
        Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
        Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
        SHORT_FORMAT ERA by getDisplayName:AD
        SHORT_FORMAT ERA by getDisplayNames:{BC=0, AD=1}

        Attachments

          Issue Links

            Activity

              People

                naoto Naoto Sato
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: