-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b19
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8205876 | 11.0.1 | Jonathan Gibbons | P3 | Resolved | Fixed | team |
-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)).
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)).
- backported by
-
JDK-8205876 -locale option issues
-
- Resolved
-