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

-locale option issues

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b19
    • Verification:
      Verified

      Backports

        Description

        -locale option issues:
        Language length is limited by 2 symbols (see jdk.javadoc.internal.tool.Start.getLocale(String localeName)):
                ............................................................
                } else if (firstuscore == -1 && localeName.length() == 2) {
                    language = localeName;
                } else {
                    usageError("main.malformed_locale_name", localeName);
                ............................................................
        Incorrect code in searchLocale() method:
               for (Locale loc : Locale.getAvailableLocales()) {
                    if (loc.getLanguage().equals(language) &&
                        (country == null || loc.getCountry().equals(country)) &&
                        (variant == null || loc.getVariant().equals(variant))) {
                        return loc;
                    }
                    ............................................................
        The country code of the "loc" variable is ignored so the "en_US" locale can be selected instead of "US".

        (Probably it would be better to use Locale.forLanguageTag(String)).

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jjg Jonathan Gibbons
                Reporter:
                ogb Oleg Barbashov (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: