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

CLDR adapter can not be invoked when region code is specified in Locale

    Details

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

      Description

      This problem happens in b54 JCG pit build and will happen in promotion build (possibly from b55) when 6336885 is fix delivered.

      If the Locale is constructed with both language and country/region code, the CLDR adapter often can not be used, even it's the first in java.locale.providers. For example, if the Locale is new Locale("zh", "CN"), CLDR adapter will not be loaded even it's the first in the list of java.locales.providers. If we use new Locale("zh"), CLDR adapter will be loaded.

      In Java, if we do not specify the Locale when calling methods like DateFormat.getTimeInstance(), the default locale is used. In this case, CLDR adapter sometimes can not be loaded, but some other times, CLDR adapter will be loaded. For exmaple, if default locale is en_GB, en_CA and some others, when CLDR adapter is in the first of provider list, it will be loaded, while when default locale is en_US, CLDR adapter will not be loaded even it's the first of provider list. This inconsistency will make the user confused. On some underlying OS, for example, windows en_GB, the CLDR adapter is used, while on some other OS, for example, windows en_US, the JRE adapter is loade, though the adapter options are the same.

      I set the priority as 4, because there is the option NOT to add JRE locale data as fall back data. When JRE adapter is not the fallback, above problem will disappear.

      Sorry that so far I can not find the option not to add JRE as the fallback.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naoto Naoto Sato
                Reporter:
                yhuang Yong Huang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: