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

In some cases, by default, Timezone display name is different when -Djava.locale.providers=CLDR is used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 11, 17, 21
    • core-libs

      Found this issue as part of backporting JDK-8358095 to 21u.
      As per Java doc of LocaleServiceProvider
      It says,
      /*
       * The default order for looking up the preferred locale providers is "CLDR,COMPAT",
       * so specifying "CLDR,COMPAT" is identical to the default behavior.
      */
      Which means it has to look up in CLDR first, but in some cases it is not happening.
      Example code:
      TimeZone.getTimeZone("Europe/Saratov").getDisplayName(true,TimeZone.LONG,Locale.US);

      Output for above code differs when -Djava.locale.providers=CLDR is used.

      a) Without passing option "-Djava.locale.providers", this code returns output
      "Saratov Standard Time"
      b)If "-Djava.locale.providers=COMPAT" is passed, it is returning "Saratov Standard Time"
      c) If "-Djava.locale.providers=CLDR" is passed, it is returning "Saratov Daylight Time"

      -------------
      In jdk25 case, without passing "-Djava.locale.providers” code is returning "Saratov Daylight Time”

      Change in behavior of jdk 21u and 25u is due to removal of compat data provider as part of https://bugs.openjdk.org/browse/JDK-8174269

            naoto Naoto Sato
            hkummari Hari Prasad Kummari
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: