Skip to content

Commit 77a1c43

Browse files
gnrungesffc
authored andcommitted
ICU-13829 Merge pull request unicode-org#25 from gnrunge/icu4j_13829
ICU-13829 Languagematcher: Fixes straightforward code issues.
2 parents e21982c + 95f7cad commit 77a1c43

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

icu4j/main/classes/core/src/com/ibm/icu/impl/locale/XLikelySubtags.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ static LSR from(String languageIdentifier) {
143143
throw new ICUException("too many subtags");
144144
}
145145
String lang = parts[0].toLowerCase();
146-
String p2 = parts.length < 2 ? "": parts[1];
147-
String p3 = parts.length < 3 ? "": parts[2];
146+
String p2 = parts.length < 2 ? "" : parts[1];
147+
String p3 = parts.length < 3 ? "" : parts[2];
148148
return p2.length() < 4 ? new LSR(lang, "", p2) : new LSR(lang, p2, p3);
149149

150150
// Matcher matcher = LANGUAGE_PATTERN.matcher(languageIdentifier);
@@ -166,7 +166,7 @@ public static LSR fromMaximalized(ULocale locale) {
166166
public static LSR fromMaximalized(String language, String script, String region) {
167167
String canonicalLanguage = LANGUAGE_ALIASES.getCanonical(language);
168168
// script is ok
169-
String canonicalRegion = REGION_ALIASES.getCanonical(region); // getCanonical(REGION_ALIASES.get(region));
169+
String canonicalRegion = REGION_ALIASES.getCanonical(region);
170170

171171
return DEFAULT.maximize(canonicalLanguage, script, canonicalRegion);
172172
}

icu4j/main/classes/core/src/com/ibm/icu/impl/locale/XLocaleDistance.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,15 +739,15 @@ public enum DistanceOption {NORMAL, SCRIPT_FIRST}
739739
* ULocales must be in canonical, addLikelySubtags format. Returns distance
740740
*/
741741
public int distanceRaw(
742-
String desiredLang, String supportedlang,
742+
String desiredLang, String supportedLang,
743743
String desiredScript, String supportedScript,
744744
String desiredRegion, String supportedRegion,
745745
int threshold,
746746
DistanceOption distanceOption) {
747747

748748
Output<DistanceTable> subtable = new Output<DistanceTable>();
749749

750-
int distance = languageDesired2Supported.getDistance(desiredLang, supportedlang, subtable, true);
750+
int distance = languageDesired2Supported.getDistance(desiredLang, supportedLang, subtable, true);
751751
boolean scriptFirst = distanceOption == DistanceOption.SCRIPT_FIRST;
752752
if (scriptFirst) {
753753
distance >>= 2;

icu4j/main/classes/core/src/com/ibm/icu/impl/locale/XLocaleMatcher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public class XLocaleMatcher {
4040
private final Set<ULocale> exactSupportedLocales; // the locales in the collection are ordered!
4141
private final ULocale defaultLanguage;
4242

43-
4443
public static class Builder {
4544
private Set<ULocale> supportedLanguagesList;
4645
private int thresholdDistance = -1;

0 commit comments

Comments
 (0)