Skip to content

Commit

Permalink
CLDR-17535 Another cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
macchiati committed Aug 20, 2024
1 parent df8f070 commit d9b86b0
Showing 1 changed file with 0 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.regex.Matcher;
import org.unicode.cldr.draft.ScriptMetadata;
import org.unicode.cldr.draft.ScriptMetadata.Info;
import org.unicode.cldr.tool.GenerateMaximalLocales;
import org.unicode.cldr.tool.LikelySubtags;
import org.unicode.cldr.util.Builder;
import org.unicode.cldr.util.CLDRConfig;
Expand Down Expand Up @@ -886,50 +885,6 @@ public void TestCldrFileConsistency() {

Matcher aliasMatcher = PatternCache.get("//ldml.*/alias.*").matcher("");

private String minimize(Map<String, String> likelySubtags, String locale) {
String result = GenerateMaximalLocales.minimize(locale, likelySubtags, false);
if (result == null) {
LanguageTagParser ltp3 = new LanguageTagParser().set(locale);
List<String> variants = ltp3.getVariants();
Map<String, String> extensions = ltp3.getExtensions();
Set<String> emptySet = Collections.emptySet();
ltp3.setVariants(emptySet);
Map<String, String> emptyMap = Collections.emptyMap();
ltp3.setExtensions(emptyMap);
String newLocale = ltp3.toString();
result = GenerateMaximalLocales.minimize(newLocale, likelySubtags, false);
if (result != null) {
ltp3.set(result);
ltp3.setVariants(variants);
ltp3.setExtensions(extensions);
result = ltp3.toString();
}
}
return result;
}

private String maximize(Map<String, String> likelySubtags, String locale) {
String result = GenerateMaximalLocales.maximize(locale, likelySubtags);
if (result == null) {
LanguageTagParser ltp3 = new LanguageTagParser().set(locale);
List<String> variants = ltp3.getVariants();
Map<String, String> extensions = ltp3.getExtensions();
Set<String> emptySet = Collections.emptySet();
ltp3.setVariants(emptySet);
Map<String, String> emptyMap = Collections.emptyMap();
ltp3.setExtensions(emptyMap);
String newLocale = ltp3.toString();
result = GenerateMaximalLocales.maximize(newLocale, likelySubtags);
if (result != null) {
ltp3.set(result);
ltp3.setVariants(variants);
ltp3.setExtensions(extensions);
result = ltp3.toString();
}
}
return result;
}

// TODO move this into central utilities
public static boolean equals(CharSequence string, int codePoint) {
if (string == null) {
Expand Down

0 comments on commit d9b86b0

Please sign in to comment.