This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit af1f7083e76c3f5b353958e14b222abc3a96f5a9 Author: Gary D. Gregory <[email protected]> AuthorDate: Sun Oct 5 10:49:22 2025 -0400 Formatting nits --- src/main/java/org/apache/commons/lang3/LocaleUtils.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/LocaleUtils.java b/src/main/java/org/apache/commons/lang3/LocaleUtils.java index a0ea3199d..5e9717568 100644 --- a/src/main/java/org/apache/commons/lang3/LocaleUtils.java +++ b/src/main/java/org/apache/commons/lang3/LocaleUtils.java @@ -132,8 +132,8 @@ public static List<Locale> countriesByLanguage(final String languageCode) { if (languageCode == null) { return Collections.emptyList(); } - return cCountriesByLanguage.computeIfAbsent(languageCode, lc -> Collections.unmodifiableList( - availableLocaleList(locale -> languageCode.equals(locale.getLanguage()) && !hasCountry(locale) && hasVariant(locale)))); + return cCountriesByLanguage.computeIfAbsent(languageCode, lc -> Collections + .unmodifiableList(availableLocaleList(locale -> languageCode.equals(locale.getLanguage()) && !hasCountry(locale) && hasVariant(locale)))); } /** @@ -246,7 +246,7 @@ public static List<Locale> languagesByCountry(final String countryCode) { return Collections.emptyList(); } return cLanguagesByCountry.computeIfAbsent(countryCode, - k -> Collections.unmodifiableList(availableLocaleList(locale -> countryCode.equals(locale.getCountry()) && hasVariant(locale)))); + k -> Collections.unmodifiableList(availableLocaleList(locale -> countryCode.equals(locale.getCountry()) && hasVariant(locale)))); } /** @@ -326,9 +326,7 @@ private static Locale parseLocale(final String str) { } else if (segments.length == limit) { final String country = segments[1]; final String variant = segments[2]; - if (isISO639LanguageCode(language) && - (country.isEmpty() || isISO3166CountryCode(country) || isNumericAreaCode(country)) && - !variant.isEmpty()) { + if (isISO639LanguageCode(language) && (country.isEmpty() || isISO3166CountryCode(country) || isNumericAreaCode(country)) && !variant.isEmpty()) { return new Locale(language, country, variant); } } @@ -413,7 +411,6 @@ public static Locale toLocale(final String str) { } return new Locale(StringUtils.EMPTY, str.substring(1, 3), str.substring(4)); } - return parseLocale(str); }
