From c0e4ebcb6166c8450685344aec33e0a0b9dcbf16 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 4 Aug 2023 12:59:32 -0500 Subject: [PATCH 1/2] CLDR-7277 update ConsoleCheck to run in parallel about 2x improvement, could be improved especially when targetting batch mode --- .../unicode/cldr/test/ConsoleCheckCLDR.java | 211 ++++++++---------- 1 file changed, 93 insertions(+), 118 deletions(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java index 0d8b72db6a8..47a494f9a2a 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java @@ -30,6 +30,7 @@ import org.unicode.cldr.draft.FileUtilities; import org.unicode.cldr.test.CheckCLDR.CheckStatus; import org.unicode.cldr.test.CheckCLDR.CheckStatus.Subtype; +import org.unicode.cldr.test.TestCache.TestResultBundle; import org.unicode.cldr.test.CheckCLDR.CompoundCheckCLDR; import org.unicode.cldr.test.CheckCLDR.FormatDemo; import org.unicode.cldr.test.CheckCLDR.Options; @@ -307,21 +308,8 @@ public static void main(String[] args) throws IOException { "(en|ru|nl|fr|de|it|pl|es|tr|th|ja|zh|ko|ar|bg|sr|uk|ca|hr|cs|da|fil|fi|hu|id|lv|lt|no|pt|ro|sk|sl|sv|vi|el|he|fa|hi|am|af|et|is|ms|sw|zu|bn|mr|ta|eu|gl|ur|gu|kn|ml|te|zh_Hant|pt_PT|en_GB)"; } String checkFilter = options[TEST_FILTER].value; - String subtypeFilterString = options[SUBTYPE_FILTER].value; - EnumSet subtypeFilter = null; - if (subtypeFilterString != null) { - subtypeFilter = EnumSet.noneOf(Subtype.class); - Matcher m = PatternCache.get(subtypeFilterString).matcher(""); - for (Subtype value : Subtype.values()) { - if (m.reset(value.toString()).find() || m.reset(value.name()).find()) { - subtypeFilter.add(value); - } - } - if (subtypeFilter.size() == 0) { - System.err.println("No subtype match for " + subtypeFilterString); - return; - } - } + // final String subtypeFilterString = options[SUBTYPE_FILTER].value; + final EnumSet subtypeFilter = null; errorsOnly = options[ERRORS_ONLY].doesOccur; boolean showMissing = MyOptions.missingPaths.option.doesOccur(); @@ -330,25 +318,14 @@ public static void main(String[] args) throws IOException { boolean showAll = options[SHOWALL].doesOccur; boolean checkFlexibleDates = options[DATE_FORMATS].doesOccur; String pathFilterString = options[PATH_FILTER].value; - Matcher pathFilter = null; - if (!pathFilterString.equals(".*")) { - pathFilter = PatternCache.get(pathFilterString).matcher(""); - } + final Matcher pathFilter = null; + // if (!pathFilterString.equals(".*")) { + // pathFilter = PatternCache.get(pathFilterString).matcher(""); + // } boolean checkOnSubmit = options[CHECK_ON_SUBMIT].doesOccur; boolean noaliases = options[NO_ALIASES].doesOccur; - Level coverageLevel = null; - String coverageLevelInput = options[COVERAGE].value; - if (coverageLevelInput != null) { - coverageLevel = Level.get(coverageLevelInput); - if (coverageLevel == Level.UNDETERMINED) { - throw new IllegalArgumentException( - "-c" - + coverageLevelInput - + "\t is invalid: must be one of: " - + "basic,moderate,..."); - } - } + final Level coverageLevel = null; Organization organization = options[ORGANIZATION].value == null @@ -422,12 +399,12 @@ public static void main(String[] args) throws IOException { } } - if (options[GENERATE_HTML].doesOccur) { - coverageLevel = Level.MODERN; // reset - ErrorFile.generated_html_directory = options[GENERATE_HTML].value; - ErrorFile.generated_html_count = - FileUtilities.openUTF8Writer(ErrorFile.generated_html_directory, "count.txt"); - } + // if (options[GENERATE_HTML].doesOccur) { + // coverageLevel = Level.MODERN; // reset + // ErrorFile.generated_html_directory = options[GENERATE_HTML].value; + // ErrorFile.generated_html_count = + // FileUtilities.openUTF8Writer(ErrorFile.generated_html_directory, "count.txt"); + // } idView = options[ID_VIEW].doesOccur; @@ -455,30 +432,18 @@ public static void main(String[] args) throws IOException { Factory cldrFactory = SimpleFactory.make(sourceDirectories, factoryFilter) .setSupplementalDirectory(new File(CLDRPaths.SUPPLEMENTAL_DIRECTORY)); - CompoundCheckCLDR checkCldr = CheckCLDR.getCheckAll(cldrFactory, checkFilter); - if (checkCldr.getFilteredTestList().size() == 0) { - throw new IllegalArgumentException("The filter doesn't match any tests."); - } - System.out.println("filtered tests: " + checkCldr.getFilteredTests()); + TestCache testCache = new TestCache(); // for parallelism + testCache.setFactory(cldrFactory, checkFilter); Factory backCldrFactory = CLDRConfig.getInstance().getMainAndAnnotationsFactory(); english = backCldrFactory.make("en", true); CheckCLDR.setDisplayInformation(english); - checkCldr.setEnglishFile(english); - setExampleGenerator(new ExampleGenerator(english, english)); PathShower pathShower = new PathShower(); // call on the files Set locales = new TreeSet<>(baseFirstCollator); locales.addAll(cldrFactory.getAvailable()); - List result = new ArrayList<>(); - Set paths = new TreeSet<>(); // CLDRFile.ldmlComparator); - Map m = new TreeMap<>(); - Map options = new HashMap<>(); - FlexibleDateFromCLDR fset = new FlexibleDateFromCLDR(); - Set englishPaths = null; - Set fatalErrors = new TreeSet<>(); showHeaderLine(); @@ -493,17 +458,38 @@ public static void main(String[] args) throws IOException { StandardCodes.make().getLocaleToLevel(organization); final List specialPurposeLocales = new ArrayList<>(Arrays.asList("en_US_POSIX")); - for (String localeID : locales) { - if (CLDRFile.isSupplementalName(localeID)) continue; + HashSet ep = new HashSet<>(); + final CLDRFile displayFile = CheckCLDR.getDisplayInformation(); + addPrettyPaths( + displayFile, pathFilter, pathHeaderFactory, noaliases, true, ep); + addPrettyPaths( + displayFile, + displayFile.getExtraPaths(), + pathFilter, + pathHeaderFactory, + noaliases, + true, + ep); + final Set englishPaths = Collections.unmodifiableSet(ep); // for robustness + + locales.parallelStream().forEach(localeID -> { + + List result = new ArrayList<>(); + Set paths = new TreeSet<>(); // CLDRFile.ldmlComparator); + Map m = new TreeMap<>(); + Map options = new HashMap<>(); + FlexibleDateFromCLDR fset = new FlexibleDateFromCLDR(); + + if (CLDRFile.isSupplementalName(localeID)) return; if (supplementalDataInfo.getDefaultContentLocales().contains(localeID)) { System.out.println("# Skipping default content locale: " + localeID); - continue; + return; } // We don't really need to check the POSIX locale, as it is a special purpose locale if (specialPurposeLocales.contains(localeID)) { System.out.println("# Skipping special purpose locale: " + localeID); - continue; + return; } boolean isLanguageLocale = @@ -520,10 +506,10 @@ public static void main(String[] args) throws IOException { level = Level.MODERN; } if (organization != null) { - if (locale_status == null) continue; + if (locale_status == null) return; level = locale_status.get(localeID); - if (level == null) continue; - if (level.compareTo(Level.BASIC) < 0) continue; + if (level == null) return; + if (level.compareTo(Level.BASIC) < 0) return; } else if (!isLanguageLocale) { // otherwise, skip all language locales options.put(Options.Option.CheckCoverage_skip.getKey(), "true"); @@ -534,6 +520,9 @@ public static void main(String[] args) throws IOException { // organization.toString()); options.put(Options.Option.phase.getKey(), phase.toString()); + // neded + options.put(Options.Option.locale.getKey(), localeID); + if (SHOW_LOCALE) System.out.println(); CLDRFile file; @@ -554,18 +543,22 @@ public static void main(String[] args) throws IOException { fatalErrors.add(localeID); System.out.println("FATAL ERROR: " + localeID); e.printStackTrace(System.out); - continue; + return; } + + TestResultBundle bundle = testCache.getBundle(new CheckCLDR.Options(options)); + + // generate HTML if asked for - if (ErrorFile.generated_html_directory != null) { - String baseLanguage = localeIDParser.set(localeID).getLanguageScript(); + // if (ErrorFile.generated_html_directory != null) { + // String baseLanguage = localeIDParser.set(localeID).getLanguageScript(); - if (!baseLanguage.equals(lastBaseLanguage)) { - lastBaseLanguage = baseLanguage; - ErrorFile.openErrorFile(localeID, baseLanguage); - } - } + // if (!baseLanguage.equals(lastBaseLanguage)) { + // lastBaseLanguage = baseLanguage; + // ErrorFile.openErrorFile(localeID, baseLanguage); + // } + // } if (user != null) { file = new CLDRFile.TestUser(file, user, isLanguageLocale); @@ -573,7 +566,7 @@ public static void main(String[] args) throws IOException { parent = new CLDRFile.TestUser(parent, user, isLanguageLocale); } } - checkCldr.setCldrFileToCheck(file, new Options(options), result); + // checkCldr.setCldrFileToCheck(file, new Options(options), result); subtotalCount.clear(); @@ -626,24 +619,6 @@ public static void main(String[] args) throws IOException { } } - // also add the English paths - // initialize the first time in. - if (englishPaths == null) { - englishPaths = new HashSet<>(); - final CLDRFile displayFile = CheckCLDR.getDisplayInformation(); - addPrettyPaths( - displayFile, pathFilter, pathHeaderFactory, noaliases, true, englishPaths); - addPrettyPaths( - displayFile, - displayFile.getExtraPaths(), - pathFilter, - pathHeaderFactory, - noaliases, - true, - englishPaths); - englishPaths = Collections.unmodifiableSet(englishPaths); // for robustness - } - UnicodeSet missingExemplars = new UnicodeSet(); UnicodeSet missingCurrencyExemplars = new UnicodeSet(); if (checkFlexibleDates) { @@ -721,20 +696,20 @@ public static void main(String[] args) throws IOException { } String example = ""; - if (SHOW_EXAMPLES) { - example = - ExampleGenerator.simplify(exampleGenerator.getExampleHtml(path, value)); - showExamples(checkCldr, prettyPath, localeID, path, value, fullPath, example); - } + // if (SHOW_EXAMPLES) { + // example = + // ExampleGenerator.simplify(exampleGenerator.getExampleHtml(path, value)); + // showExamples(checkCldr, prettyPath, localeID, path, value, fullPath, example); + // } if (checkFlexibleDates) { fset.checkFlexibles(path, value, fullPath); } int limit = 1; for (int jj = 0; jj < limit; ++jj) { if (jj == 0) { - checkCldr.check(path, fullPath, value, new Options(options), result); + bundle.check(path, result, value); } else { - checkCldr.getExamples(path, fullPath, value, new Options(options), result); + bundle.getExamples(path, value, result); } boolean showedOne = false; @@ -867,33 +842,33 @@ public static void main(String[] args) throws IOException { if (checkFlexibleDates) { fset.showFlexibles(); } - if (SHOW_EXAMPLES) { - // ldml/dates/timeZoneNames/zone[@type="America/Argentina/San_Juan"]/exemplarCity - for (String zone : StandardCodes.make().getGoodAvailableCodes("tzid")) { - String path = - "//ldml/dates/timeZoneNames/zone[@type=\"" + zone + "\"]/exemplarCity"; - PathHeader pathHeader = pathHeaderFactory.fromPath(path); - String prettyPath = pathHeader.toString().replace('\t', '|').replace(' ', '_'); - if (pathFilter != null && !pathFilter.reset(path).matches()) { - continue; - } - String fullPath = file.getStringValue(path); - if (fullPath != null) { - continue; - } - /* - * TODO: fix this code. Calling getExampleHtml with value = null will always return null, - * so what's this supposed to accomplish? - */ - String example = - ExampleGenerator.simplify( - exampleGenerator.getExampleHtml(path, null /* value */)); - showExamples(checkCldr, prettyPath, localeID, path, null, fullPath, example); - } - } + // if (SHOW_EXAMPLES) { + // // ldml/dates/timeZoneNames/zone[@type="America/Argentina/San_Juan"]/exemplarCity + // for (String zone : StandardCodes.make().getGoodAvailableCodes("tzid")) { + // String path = + // "//ldml/dates/timeZoneNames/zone[@type=\"" + zone + "\"]/exemplarCity"; + // PathHeader pathHeader = pathHeaderFactory.fromPath(path); + // String prettyPath = pathHeader.toString().replace('\t', '|').replace(' ', '_'); + // if (pathFilter != null && !pathFilter.reset(path).matches()) { + // continue; + // } + // String fullPath = file.getStringValue(path); + // if (fullPath != null) { + // continue; + // } + // /* + // * TODO: fix this code. Calling getExampleHtml with value = null will always return null, + // * so what's this supposed to accomplish? + // */ + // String example = + // ExampleGenerator.simplify( + // exampleGenerator.getExampleHtml(path, null /* value */)); + // showExamples(checkCldr, prettyPath, localeID, path, null, fullPath, example); + // } + // } System.out.println("# Elapsed time: " + timer); System.out.flush(); - } + }); if (ErrorFile.errorFileWriter != null) { ErrorFile.closeErrorFile(); @@ -927,7 +902,7 @@ public static void main(String[] args) throws IOException { System.out.println(s + "=" + LogicalGrouping.typeCount.get(s)); } } - checkCldr.handleFinish(); + // checkCldr.handleFinish(); } // end of main() static class LocaleVotingData { From 8e2ef1c46505893a3161e7225fedbb7bd1932b4d Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 30 Nov 2023 14:56:56 -0600 Subject: [PATCH 2/2] CLDR-7277 update parallel ConsoleCheckCLDR - new option "-1" to request sequential console check - runs in sequential mode under certain circumstances - also, added CheckCLDR.toString() to just show a simple class name --- .../java/org/unicode/cldr/test/CheckCLDR.java | 5 + .../unicode/cldr/test/ConsoleCheckCLDR.java | 876 ++++++++++-------- 2 files changed, 495 insertions(+), 386 deletions(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java index 2e75cf38633..ec50356a916 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java @@ -63,6 +63,11 @@ */ public abstract class CheckCLDR implements CheckAccessor { + /** serialize CheckCLDR as just its class name */ + public String toString() { + return getClass().getSimpleName(); + } + public static final boolean LIMITED_SUBMISSION = false; // TODO: CLDR-13337: represent differently diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java index 47a494f9a2a..84ecdaec131 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java @@ -14,11 +14,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.EnumSet; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -27,15 +25,16 @@ import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; +import java.util.stream.Stream; import org.unicode.cldr.draft.FileUtilities; import org.unicode.cldr.test.CheckCLDR.CheckStatus; import org.unicode.cldr.test.CheckCLDR.CheckStatus.Subtype; -import org.unicode.cldr.test.TestCache.TestResultBundle; import org.unicode.cldr.test.CheckCLDR.CompoundCheckCLDR; import org.unicode.cldr.test.CheckCLDR.FormatDemo; import org.unicode.cldr.test.CheckCLDR.Options; import org.unicode.cldr.test.CheckCLDR.Phase; import org.unicode.cldr.test.CheckCLDR.SimpleDemo; +import org.unicode.cldr.test.TestCache.TestResultBundle; import org.unicode.cldr.tool.Option; import org.unicode.cldr.tool.Option.Params; import org.unicode.cldr.tool.ShowData; @@ -117,7 +116,8 @@ public class ConsoleCheckCLDR { VOTE_RESOLVE = 17, ID_VIEW = 18, SUBTYPE_FILTER = 19, - BAILEY = 21; + BAILEY = 21, + SINGLE_THREAD = 24; static final String SOURCE_DIRS = CLDRPaths.MAIN_DIRECTORY @@ -216,7 +216,8 @@ enum MyOptions { missingPaths( new Params() .setHelp( - "include to show missing and provisional paths, at the specified level")); + "include to show missing and provisional paths, at the specified level")), + singleThread(new Params().setHelp("Run in single-thread mode.").setFlag('1')); // BOILERPLATE TO COPY final Option option; @@ -238,7 +239,7 @@ private static Set parse(String[] args, boolean showArguments) { } } - // TODO get ride of these in favor of MyOptions + // TODO get rid of these in favor of MyOptions private static final UOption[] options = { UOption.HELP_H(), @@ -265,7 +266,8 @@ private static Set parse(String[] args, boolean showArguments) { UOption.create("source_all", 'S', UOption.OPTIONAL_ARG).setDefault("common,seed,exemplars"), UOption.create("bailey", 'b', UOption.NO_ARG), UOption.create("exemplarError", 'E', UOption.NO_ARG), - UOption.create("missingPaths", 'm', UOption.NO_ARG) + UOption.create("missingPaths", 'm', UOption.NO_ARG), + UOption.create("singleThread", '1', UOption.NO_ARG) }; private static final Comparator baseFirstCollator = @@ -292,13 +294,56 @@ private enum RawStatus { provisional, present } + + private static EnumSet calculateSubtypeFilter(final String subtypeFilterString) { + EnumSet subtypeFilter = null; + if (subtypeFilterString != null) { + subtypeFilter = EnumSet.noneOf(Subtype.class); + Matcher m = PatternCache.get(subtypeFilterString).matcher(""); + for (Subtype value : Subtype.values()) { + if (m.reset(value.toString()).find() || m.reset(value.name()).find()) { + subtypeFilter.add(value); + } + } + if (subtypeFilter.size() == 0) { + throw new IllegalArgumentException("No subtype match for " + subtypeFilterString); + } + } + return subtypeFilter; + } + + static Matcher calculatePathFilter(final String pathFilterString) { + if (!pathFilterString.equals(".*")) { + return PatternCache.get(pathFilterString).matcher(""); + } else { + return null; + } + } + + static Level calculateCoverageLevel(final String coverageLevelInput, boolean forHtml) { + Level coverageLevel = null; + if (forHtml) { + coverageLevel = Level.MODERN; // reset + } else if (coverageLevelInput != null) { + coverageLevel = Level.get(coverageLevelInput); + if (coverageLevel == Level.UNDETERMINED) { + throw new IllegalArgumentException( + "-c" + + coverageLevelInput + + "\t is invalid: must be one of: " + + "basic,moderate,..."); + } + } + return coverageLevel; + } + /** * This will be the test framework way of using these tests. * * @param args - * @throws IOException + * @throws Throwable */ - public static void main(String[] args) throws IOException { + public static void main(String[] args) throws Throwable { MyOptions.parse(args, true); ElapsedTimer totalTimer = new ElapsedTimer(); UOption.parseArgs(args, options); @@ -308,8 +353,8 @@ public static void main(String[] args) throws IOException { "(en|ru|nl|fr|de|it|pl|es|tr|th|ja|zh|ko|ar|bg|sr|uk|ca|hr|cs|da|fil|fi|hu|id|lv|lt|no|pt|ro|sk|sl|sv|vi|el|he|fa|hi|am|af|et|is|ms|sw|zu|bn|mr|ta|eu|gl|ur|gu|kn|ml|te|zh_Hant|pt_PT|en_GB)"; } String checkFilter = options[TEST_FILTER].value; - // final String subtypeFilterString = options[SUBTYPE_FILTER].value; - final EnumSet subtypeFilter = null; + final String subtypeFilterString = options[SUBTYPE_FILTER].value; + final EnumSet subtypeFilter = calculateSubtypeFilter(subtypeFilterString); errorsOnly = options[ERRORS_ONLY].doesOccur; boolean showMissing = MyOptions.missingPaths.option.doesOccur(); @@ -317,15 +362,13 @@ public static void main(String[] args) throws IOException { SHOW_EXAMPLES = options[EXAMPLES].doesOccur; boolean showAll = options[SHOWALL].doesOccur; boolean checkFlexibleDates = options[DATE_FORMATS].doesOccur; - String pathFilterString = options[PATH_FILTER].value; - final Matcher pathFilter = null; - // if (!pathFilterString.equals(".*")) { - // pathFilter = PatternCache.get(pathFilterString).matcher(""); - // } + final String pathFilterString = options[PATH_FILTER].value; + final Matcher pathFilter = calculatePathFilter(pathFilterString); boolean checkOnSubmit = options[CHECK_ON_SUBMIT].doesOccur; boolean noaliases = options[NO_ALIASES].doesOccur; - final Level coverageLevel = null; + final Level coverageLevel = + calculateCoverageLevel(options[COVERAGE].value, options[GENERATE_HTML].doesOccur); Organization organization = options[ORGANIZATION].value == null @@ -399,12 +442,16 @@ public static void main(String[] args) throws IOException { } } - // if (options[GENERATE_HTML].doesOccur) { - // coverageLevel = Level.MODERN; // reset - // ErrorFile.generated_html_directory = options[GENERATE_HTML].value; - // ErrorFile.generated_html_count = - // FileUtilities.openUTF8Writer(ErrorFile.generated_html_directory, "count.txt"); - // } + if (options[GENERATE_HTML].doesOccur) { + ErrorFile.generated_html_directory = options[GENERATE_HTML].value; + ErrorFile.generated_html_count = + FileUtilities.openUTF8Writer(ErrorFile.generated_html_directory, "count.txt"); + } + + final boolean sequential = + SHOW_EXAMPLES + || options[GENERATE_HTML].doesOccur + || options[SINGLE_THREAD].doesOccur; idView = options[ID_VIEW].doesOccur; @@ -434,10 +481,21 @@ public static void main(String[] args) throws IOException { .setSupplementalDirectory(new File(CLDRPaths.SUPPLEMENTAL_DIRECTORY)); TestCache testCache = new TestCache(); // for parallelism testCache.setFactory(cldrFactory, checkFilter); + + { + // we create an extraneous CompoundCheckCLDR here just to check the filters + CompoundCheckCLDR checkCldr = CheckCLDR.getCheckAll(cldrFactory, checkFilter); + if (checkCldr.getFilteredTestList().size() == 0) { + throw new IllegalArgumentException("The filter doesn't match any tests."); + } + System.out.println("filtered tests: " + checkCldr.getFilteredTests()); + } + Factory backCldrFactory = CLDRConfig.getInstance().getMainAndAnnotationsFactory(); english = backCldrFactory.make("en", true); CheckCLDR.setDisplayInformation(english); + setExampleGenerator(new ExampleGenerator(english, english)); PathShower pathShower = new PathShower(); // call on the files @@ -451,291 +509,159 @@ public static void main(String[] args) throws IOException { supplementalDataInfo = SupplementalDataInfo.getInstance(CLDRPaths.SUPPLEMENTAL_DIRECTORY); LocaleIDParser localeIDParser = new LocaleIDParser(); - String lastBaseLanguage = ""; PathHeader.Factory pathHeaderFactory = PathHeader.getFactory(english); final Map locale_status = StandardCodes.make().getLocaleToLevel(organization); final List specialPurposeLocales = new ArrayList<>(Arrays.asList("en_US_POSIX")); - HashSet ep = new HashSet<>(); - final CLDRFile displayFile = CheckCLDR.getDisplayInformation(); - addPrettyPaths( - displayFile, pathFilter, pathHeaderFactory, noaliases, true, ep); - addPrettyPaths( - displayFile, - displayFile.getExtraPaths(), - pathFilter, - pathHeaderFactory, - noaliases, - true, - ep); - final Set englishPaths = Collections.unmodifiableSet(ep); // for robustness - - locales.parallelStream().forEach(localeID -> { - - List result = new ArrayList<>(); - Set paths = new TreeSet<>(); // CLDRFile.ldmlComparator); - Map m = new TreeMap<>(); - Map options = new HashMap<>(); - FlexibleDateFromCLDR fset = new FlexibleDateFromCLDR(); - - if (CLDRFile.isSupplementalName(localeID)) return; - if (supplementalDataInfo.getDefaultContentLocales().contains(localeID)) { - System.out.println("# Skipping default content locale: " + localeID); - return; - } - - // We don't really need to check the POSIX locale, as it is a special purpose locale - if (specialPurposeLocales.contains(localeID)) { - System.out.println("# Skipping special purpose locale: " + localeID); - return; - } - - boolean isLanguageLocale = - localeID.equals(localeIDParser.set(localeID).getLanguageScript()); - options.clear(); - - if (MyOptions.exemplarError.option.doesOccur()) { - options.put(Options.Option.exemplarErrors.toString(), "true"); - } - - // if the organization is set, skip any locale that doesn't have a value in Locales.txt - Level level = coverageLevel; - if (level == null) { - level = Level.MODERN; - } - if (organization != null) { - if (locale_status == null) return; - level = locale_status.get(localeID); - if (level == null) return; - if (level.compareTo(Level.BASIC) < 0) return; - } else if (!isLanguageLocale) { - // otherwise, skip all language locales - options.put(Options.Option.CheckCoverage_skip.getKey(), "true"); - } - - // if (organization != null) - // options.put(Options.Option.CoverageLevel_localeType.getKey(), - // organization.toString()); - options.put(Options.Option.phase.getKey(), phase.toString()); - - // neded - options.put(Options.Option.locale.getKey(), localeID); - - if (SHOW_LOCALE) System.out.println(); - - CLDRFile file; - CLDRFile englishFile = english; - CLDRFile parent = null; - - ElapsedTimer timer = new ElapsedTimer(); - try { - file = cldrFactory.make(localeID, true); - if (ErrorFile.voteFactory != null) { - ErrorFile.voteFile = ErrorFile.voteFactory.make(localeID, true); - } - final String parentID = LocaleIDParser.getParent(localeID); - if (parentID != null) { - parent = cldrFactory.make(parentID, true); - } - } catch (RuntimeException e) { - fatalErrors.add(localeID); - System.out.println("FATAL ERROR: " + localeID); - e.printStackTrace(System.out); - return; - } - - - TestResultBundle bundle = testCache.getBundle(new CheckCLDR.Options(options)); + // TODO: englishPaths doesn't seem to be used. + // final HashSet ep = new HashSet<>(); + // final CLDRFile displayFile = CheckCLDR.getDisplayInformation(); + // addPrettyPaths( + // displayFile, pathFilter, pathHeaderFactory, noaliases, true, ep); + // addPrettyPaths( + // displayFile, + // displayFile.getExtraPaths(), + // pathFilter, + // pathHeaderFactory, + // noaliases, + // true, + // ep); + // final Set englishPaths = Collections.unmodifiableSet(ep); // for robustness + + // Set up our stream to use. It will be parallel usually, or sequential for HTML. + Stream stream; + + if (sequential) { + System.err.println("# Note: running in sequential mode."); + stream = locales.stream(); + } else { + stream = locales.parallelStream(); + } - // generate HTML if asked for - // if (ErrorFile.generated_html_directory != null) { - // String baseLanguage = localeIDParser.set(localeID).getLanguageScript(); + // now, run it + stream.forEach( + localeID -> { + if (ErrorFile.writeError != null) { + return; // get out, it's an error. + } - // if (!baseLanguage.equals(lastBaseLanguage)) { - // lastBaseLanguage = baseLanguage; - // ErrorFile.openErrorFile(localeID, baseLanguage); - // } - // } + List result = new ArrayList<>(); + Set paths = new TreeSet<>(); // CLDRFile.ldmlComparator); + Map m = new TreeMap<>(); + Map options = new HashMap<>(); + FlexibleDateFromCLDR fset = new FlexibleDateFromCLDR(); - if (user != null) { - file = new CLDRFile.TestUser(file, user, isLanguageLocale); - if (parent != null) { - parent = new CLDRFile.TestUser(parent, user, isLanguageLocale); - } - } - // checkCldr.setCldrFileToCheck(file, new Options(options), result); + if (CLDRFile.isSupplementalName(localeID)) return; + if (supplementalDataInfo.getDefaultContentLocales().contains(localeID)) { + System.out.println("# Skipping default content locale: " + localeID); + return; + } - subtotalCount.clear(); + // We don't really need to check the POSIX locale, as it is a special purpose + // locale + if (specialPurposeLocales.contains(localeID)) { + System.out.println("# Skipping special purpose locale: " + localeID); + return; + } - for (Iterator it3 = result.iterator(); it3.hasNext(); ) { - CheckStatus status = it3.next(); - String statusString = status.toString(); // com.ibm.icu.impl.Utility.escape( - CheckStatus.Type statusType = status.getType(); + boolean isLanguageLocale = + localeID.equals(localeIDParser.set(localeID).getLanguageScript()); + options.clear(); - if (errorsOnly) { - if (!statusType.equals(CheckStatus.errorType)) continue; - } + if (MyOptions.exemplarError.option.doesOccur()) { + options.put(Options.Option.exemplarErrors.toString(), "true"); + } - if (subtypeFilter != null) { - if (!subtypeFilter.contains(status.getSubtype())) { - continue; + // if the organization is set, skip any locale that doesn't have a value in + // Locales.txt + Level level = coverageLevel; + if (level == null) { + level = Level.MODERN; + } + if (organization != null) { + if (locale_status == null) return; + level = locale_status.get(localeID); + if (level == null) return; + if (level.compareTo(Level.BASIC) < 0) return; + } else if (!isLanguageLocale) { + // otherwise, skip all language locales + options.put(Options.Option.CheckCoverage_skip.getKey(), "true"); } - } - if (checkOnSubmit) { - if (!status.isCheckOnSubmit() || !statusType.equals(CheckStatus.errorType)) - continue; - } - showValue( - file, - null, - localeID, - null, - null, - null, - null, - statusString, - status.getSubtype()); - } - paths.clear(); + // if (organization != null) + // options.put(Options.Option.CoverageLevel_localeType.getKey(), + // organization.toString()); + options.put(Options.Option.phase.getKey(), phase.toString()); - CoverageInfo covInfo = cldrConf.getCoverageInfo(); - for (String path : file.fullIterable()) { - if (pathFilter != null && !pathFilter.reset(path).find()) { - continue; - } - if (level != null) { - Level currentLevel = covInfo.getCoverageLevel(path, localeID); - if (currentLevel.compareTo(level) > 0) { - continue; - } - } - final PathHeader pathHeader = pathHeaderFactory.fromPath(path); - if (pathHeader.getSectionId() != SectionId.Special) { - paths.add(pathHeader); - } - } + // also need the locale in the options + options.put(Options.Option.locale.getKey(), localeID); - UnicodeSet missingExemplars = new UnicodeSet(); - UnicodeSet missingCurrencyExemplars = new UnicodeSet(); - if (checkFlexibleDates) { - fset.set(file); - } - pathShower.set(localeID); - - // only create if we are going to use - ExampleGenerator exampleGenerator = - SHOW_EXAMPLES ? new ExampleGenerator(file, englishFile) : null; - - int pathCount = 0; - Status otherPath = new Status(); - int rawMissingCount = 0; - int rawProvisionalCount = 0; - CLDRFile unresolved = file.getUnresolved(); - - for (PathHeader pathHeader : paths) { - pathCount++; - String path = pathHeader.getOriginalPath(); - String prettyPath = pathHeader.toString().replace('\t', '|').replace(' ', '_'); - if (!showAll && !file.isWinningPath(path)) { - continue; - } - final String topValue = unresolved.getStringValue(path); - RawStatus rawStatus = RawStatus.present; + if (SHOW_LOCALE && sequential) System.out.println(); - if (topValue == null) { - rawStatus = RawStatus.missing; - rawMissingCount++; - } + CLDRFile file; + CLDRFile englishFile = english; + CLDRFile parent = null; - if (!isLanguageLocale && !baileyTest) { - final String sourceLocaleID = file.getSourceLocaleID(path, otherPath); - if (!localeID.equals(sourceLocaleID)) { - continue; - } - // also skip aliases - if (!path.equals(otherPath.pathWhereFound)) { - continue; + ElapsedTimer timer = new ElapsedTimer(); + try { + file = cldrFactory.make(localeID, true); + if (ErrorFile.voteFactory != null) { + ErrorFile.voteFile = ErrorFile.voteFactory.make(localeID, true); + } + final String parentID = LocaleIDParser.getParent(localeID); + if (parentID != null) { + parent = cldrFactory.make(parentID, true); + } + } catch (RuntimeException e) { + fatalErrors.add(localeID); + System.out.println("FATAL ERROR: " + localeID); + e.printStackTrace(System.out); + return; } - } - if (path.contains("@alt") && path.contains("proposed")) { - continue; - } - String value = file.getStringValue(path); - if (baileyTest) { - value = CldrUtility.INHERITANCE_MARKER; - } - String fullPath = file.getFullXPath(path); - if (topValue != null) { - XPathParts fullParts = XPathParts.getFrozenInstance(fullPath); - String draftStatus = fullParts.getAttributeValue(-1, "draft"); - if (draftStatus != null && !draftStatus.equals("contributed")) { - rawProvisionalCount++; - rawStatus = RawStatus.provisional; - } - } - if (showMissing && rawStatus != RawStatus.present) { - String englishValue = englishFile.getStringValue(path); - if (englishValue == null) { - englishValue = "n/a"; + TestResultBundle bundle = testCache.getBundle(new CheckCLDR.Options(options)); + + // generate HTML if asked for + if (ErrorFile.generated_html_directory != null) { + String baseLanguage = localeIDParser.set(localeID).getLanguageScript(); + + if (!baseLanguage.equals(ErrorFile.lastBaseLanguage)) { + ErrorFile.lastBaseLanguage = baseLanguage; + try { + ErrorFile.openErrorFile(localeID, baseLanguage); + } catch (IOException ioe) { + ErrorFile.writeError = ioe; + System.err.println( + "Exception " + + ioe + + " while trying to open file " + + localeID); + ioe.printStackTrace(); + return; + } + } } - System.out.println( - getLocaleAndName(localeID) - + "\tRaw " - + rawStatus - + "\t" - + pathHeader - + "\t" - + englishValue - + "\t" - + path); - } - String example = ""; - // if (SHOW_EXAMPLES) { - // example = - // ExampleGenerator.simplify(exampleGenerator.getExampleHtml(path, value)); - // showExamples(checkCldr, prettyPath, localeID, path, value, fullPath, example); - // } - if (checkFlexibleDates) { - fset.checkFlexibles(path, value, fullPath); - } - int limit = 1; - for (int jj = 0; jj < limit; ++jj) { - if (jj == 0) { - bundle.check(path, result, value); - } else { - bundle.getExamples(path, value, result); + if (user != null) { + file = new CLDRFile.TestUser(file, user, isLanguageLocale); + if (parent != null) { + parent = new CLDRFile.TestUser(parent, user, isLanguageLocale); + } } + // checkCldr.setCldrFileToCheck(file, new Options(options), result); + + subtotalCount.clear(); - boolean showedOne = false; for (Iterator it3 = result.iterator(); it3.hasNext(); ) { CheckStatus status = it3.next(); String statusString = status.toString(); // com.ibm.icu.impl.Utility.escape( CheckStatus.Type statusType = status.getType(); - Object[] parameters = status.getParameters(); - - if (parameters != null) { - if (parameters.length >= 1 - && status.getCause().getClass() == CheckForExemplars.class) { - try { - UnicodeSet set = new UnicodeSet(parameters[0].toString()); - if (status.getMessage().contains("currency")) { - missingCurrencyExemplars.addAll(set); - } else { - missingExemplars.addAll(set); - } - } catch (RuntimeException e) { - } // skip if not parseable as set - } - } - if (errorsOnly && !statusType.equals(CheckStatus.errorType)) { - continue; + if (errorsOnly) { + if (!statusType.equals(CheckStatus.errorType)) continue; } if (subtypeFilter != null) { @@ -743,137 +669,313 @@ public static void main(String[] args) throws IOException { continue; } } + if (checkOnSubmit) { if (!status.isCheckOnSubmit() || !statusType.equals(CheckStatus.errorType)) continue; } + showValue( + file, + null, + localeID, + null, + null, + null, + null, + statusString, + status.getSubtype()); + } + paths.clear(); - if (statusType.equals(CheckStatus.demoType)) { - SimpleDemo d = status.getDemo(); - if (d != null && d instanceof FormatDemo) { - FormatDemo fd = (FormatDemo) d; - m.clear(); - if (d.processPost(m)) - System.out.println("\tDemo:\t" + fd.getPlainText(m)); + CoverageInfo covInfo = cldrConf.getCoverageInfo(); + for (String path : file.fullIterable()) { + if (pathFilter != null && !pathFilter.reset(path).find()) { + continue; + } + if (level != null) { + Level currentLevel = covInfo.getCoverageLevel(path, localeID); + if (currentLevel.compareTo(level) > 0) { + continue; } + } + final PathHeader pathHeader = pathHeaderFactory.fromPath(path); + if (pathHeader.getSectionId() != SectionId.Special) { + paths.add(pathHeader); + } + } + + UnicodeSet missingExemplars = new UnicodeSet(); + UnicodeSet missingCurrencyExemplars = new UnicodeSet(); + if (checkFlexibleDates) { + fset.set(file); + } + pathShower.set(localeID); + + // only create if we are going to use it + final ExampleGenerator exampleGenerator = + SHOW_EXAMPLES ? new ExampleGenerator(file, englishFile) : null; + + int pathCount = 0; + Status otherPath = new Status(); + int rawMissingCount = 0; + int rawProvisionalCount = 0; + CLDRFile unresolved = file.getUnresolved(); + + for (PathHeader pathHeader : paths) { + pathCount++; + String path = pathHeader.getOriginalPath(); + String prettyPath = + pathHeader.toString().replace('\t', '|').replace(' ', '_'); + if (!showAll && !file.isWinningPath(path)) { continue; } + final String topValue = unresolved.getStringValue(path); + RawStatus rawStatus = RawStatus.present; - if (parameters != null) { - for (int i = 0; i < parameters.length; ++i) { - if (showStackTrace && parameters[i] instanceof Throwable) { - ((Throwable) parameters[i]).printStackTrace(); - } + if (topValue == null) { + rawStatus = RawStatus.missing; + rawMissingCount++; + } + + if (!isLanguageLocale && !baileyTest) { + final String sourceLocaleID = file.getSourceLocaleID(path, otherPath); + if (!localeID.equals(sourceLocaleID)) { + continue; + } + // also skip aliases + if (!path.equals(otherPath.pathWhereFound)) { + continue; } } + if (path.contains("@alt") && path.contains("proposed")) { + continue; + } + String value = file.getStringValue(path); + if (baileyTest) { + value = CldrUtility.INHERITANCE_MARKER; + } - showValue( - file, - prettyPath, - localeID, - example, - path, - value, - fullPath, - statusString, - status.getSubtype()); - showedOne = true; - } - if (!showedOne && phase != Phase.FINAL_TESTING) { - if (!showedOne && showAll) { - showValue( - file, - prettyPath, - localeID, - example, - path, - value, - fullPath, - "ok", - Subtype.none); - showedOne = true; + String fullPath = file.getFullXPath(path); + if (topValue != null) { + XPathParts fullParts = XPathParts.getFrozenInstance(fullPath); + String draftStatus = fullParts.getAttributeValue(-1, "draft"); + if (draftStatus != null && !draftStatus.equals("contributed")) { + rawProvisionalCount++; + rawStatus = RawStatus.provisional; + } + } + if (showMissing && rawStatus != RawStatus.present) { + String englishValue = englishFile.getStringValue(path); + if (englishValue == null) { + englishValue = "n/a"; + } + System.out.println( + getLocaleAndName(localeID) + + "\tRaw " + + rawStatus + + "\t" + + pathHeader + + "\t" + + englishValue + + "\t" + + path); + } + + String example = ""; + if (SHOW_EXAMPLES && exampleGenerator != null) { + example = + ExampleGenerator.simplify( + exampleGenerator.getExampleHtml(path, value)); + showExamples( + file, prettyPath, localeID, path, value, fullPath, example); + } + if (checkFlexibleDates) { + fset.checkFlexibles(path, value, fullPath); + } + int limit = 1; + for (int jj = 0; jj < limit; ++jj) { + if (jj == 0) { + bundle.check(path, result, value); + } else { + bundle.getExamples(path, value, result); + } + + boolean showedOne = false; + for (Iterator it3 = result.iterator(); it3.hasNext(); ) { + CheckStatus status = it3.next(); + String statusString = + status.toString(); // com.ibm.icu.impl.Utility.escape( + CheckStatus.Type statusType = status.getType(); + Object[] parameters = status.getParameters(); + + if (parameters != null) { + if (parameters.length >= 1 + && status.getCause().getClass() + == CheckForExemplars.class) { + try { + UnicodeSet set = + new UnicodeSet(parameters[0].toString()); + if (status.getMessage().contains("currency")) { + missingCurrencyExemplars.addAll(set); + } else { + missingExemplars.addAll(set); + } + } catch (RuntimeException e) { + } // skip if not parseable as set + } + } + + if (errorsOnly && !statusType.equals(CheckStatus.errorType)) { + continue; + } + + if (subtypeFilter != null) { + if (!subtypeFilter.contains(status.getSubtype())) { + continue; + } + } + if (checkOnSubmit) { + if (!status.isCheckOnSubmit() + || !statusType.equals(CheckStatus.errorType)) continue; + } + + if (statusType.equals(CheckStatus.demoType)) { + SimpleDemo d = status.getDemo(); + if (d != null && d instanceof FormatDemo) { + FormatDemo fd = (FormatDemo) d; + m.clear(); + if (d.processPost(m)) + System.out.println("\tDemo:\t" + fd.getPlainText(m)); + } + continue; + } + + if (parameters != null) { + for (int i = 0; i < parameters.length; ++i) { + if (showStackTrace && parameters[i] instanceof Throwable) { + ((Throwable) parameters[i]).printStackTrace(); + } + } + } + + showValue( + file, + prettyPath, + localeID, + example, + path, + value, + fullPath, + statusString, + status.getSubtype()); + showedOne = true; + } + if (!showedOne && phase != Phase.FINAL_TESTING) { + if (!showedOne && showAll) { + showValue( + file, + prettyPath, + localeID, + example, + path, + value, + fullPath, + "ok", + Subtype.none); + showedOne = true; + } + } } } - } - } - if (resolveVotesDirectory != null) { - LocaleVotingData.resolveErrors(localeID); - } + if (resolveVotesDirectory != null) { + LocaleVotingData.resolveErrors(localeID); + } - showSummary( - localeID, - level, - "Items:\t" - + pathCount - + "\tRaw Missing:\t" - + rawMissingCount - + "\tRaw Provisional:\t" - + rawProvisionalCount); - - if (missingExemplars.size() != 0) { - missingExemplars.removeAll( - new UnicodeSet("[[:Uppercase:]-[İ]]")); // remove uppercase #4670 - if (missingExemplars.size() != 0) { showSummary( localeID, level, - "Total missing from general exemplars:\t" - + missingExemplars.size() - + "\t" - + UnicodeSetPrettyPrinter.fromIcuLocale(localeID) - .format(missingExemplars)); - } - } - if (missingCurrencyExemplars.size() != 0) { - Collator col = Collator.getInstance(new ULocale(localeID)); - showSummary( - localeID, - level, - "Total missing from currency exemplars:\t" - + UnicodeSetPrettyPrinter.fromIcuLocale(localeID) - .format(missingCurrencyExemplars)); - } - for (ErrorType type : subtotalCount.keySet()) { - showSummary( - localeID, level, "Subtotal " + type + ":\t" + subtotalCount.getCount(type)); - } + "Items:\t" + + pathCount + + "\tRaw Missing:\t" + + rawMissingCount + + "\tRaw Provisional:\t" + + rawProvisionalCount); + + if (missingExemplars.size() != 0) { + missingExemplars.removeAll( + new UnicodeSet("[[:Uppercase:]-[İ]]")); // remove uppercase #4670 + if (missingExemplars.size() != 0) { + showSummary( + localeID, + level, + "Total missing from general exemplars:\t" + + missingExemplars.size() + + "\t" + + UnicodeSetPrettyPrinter.fromIcuLocale(localeID) + .format(missingExemplars)); + } + } + if (missingCurrencyExemplars.size() != 0) { + Collator col = Collator.getInstance(new ULocale(localeID)); + showSummary( + localeID, + level, + "Total missing from currency exemplars:\t" + + UnicodeSetPrettyPrinter.fromIcuLocale(localeID) + .format(missingCurrencyExemplars)); + } + for (ErrorType type : subtotalCount.keySet()) { + showSummary( + localeID, + level, + "Subtotal " + type + ":\t" + subtotalCount.getCount(type)); + } - if (checkFlexibleDates) { - fset.showFlexibles(); - } - // if (SHOW_EXAMPLES) { - // // ldml/dates/timeZoneNames/zone[@type="America/Argentina/San_Juan"]/exemplarCity - // for (String zone : StandardCodes.make().getGoodAvailableCodes("tzid")) { - // String path = - // "//ldml/dates/timeZoneNames/zone[@type=\"" + zone + "\"]/exemplarCity"; - // PathHeader pathHeader = pathHeaderFactory.fromPath(path); - // String prettyPath = pathHeader.toString().replace('\t', '|').replace(' ', '_'); - // if (pathFilter != null && !pathFilter.reset(path).matches()) { - // continue; - // } - // String fullPath = file.getStringValue(path); - // if (fullPath != null) { - // continue; - // } - // /* - // * TODO: fix this code. Calling getExampleHtml with value = null will always return null, - // * so what's this supposed to accomplish? - // */ - // String example = - // ExampleGenerator.simplify( - // exampleGenerator.getExampleHtml(path, null /* value */)); - // showExamples(checkCldr, prettyPath, localeID, path, null, fullPath, example); - // } - // } - System.out.println("# Elapsed time: " + timer); - System.out.flush(); - }); + if (checkFlexibleDates) { + fset.showFlexibles(); + } + if (SHOW_EXAMPLES && exampleGenerator != null) { + // ldml/dates/timeZoneNames/zone[@type="America/Argentina/San_Juan"]/exemplarCity + for (String zone : StandardCodes.make().getGoodAvailableCodes("tzid")) { + String path = + "//ldml/dates/timeZoneNames/zone[@type=\"" + + zone + + "\"]/exemplarCity"; + PathHeader pathHeader = pathHeaderFactory.fromPath(path); + String prettyPath = + pathHeader.toString().replace('\t', '|').replace(' ', '_'); + if (pathFilter != null && !pathFilter.reset(path).matches()) { + continue; + } + String fullPath = file.getStringValue(path); + if (fullPath != null) { + continue; + } + /* + * TODO: fix this code. Calling getExampleHtml with value = null will always return null, + * so what's this supposed to accomplish? + */ + String example = + ExampleGenerator.simplify( + exampleGenerator.getExampleHtml( + path, null /* value */)); + showExamples(file, prettyPath, localeID, path, null, fullPath, example); + } + } + System.out.println("# " + localeID + " Elapsed time: " + timer); + System.out.flush(); + }); if (ErrorFile.errorFileWriter != null) { ErrorFile.closeErrorFile(); } + // an error occurred opening HTML, rethrow it. + if (ErrorFile.writeError != null) { + throw ErrorFile.writeError; + } + if (ErrorFile.generated_html_directory != null) { ErrorFile.writeErrorCountsText(); ErrorFile.writeErrorFileIndex(); @@ -902,7 +1004,6 @@ public static void main(String[] args) throws IOException { System.out.println(s + "=" + LogicalGrouping.typeCount.get(s)); } } - // checkCldr.handleFinish(); } // end of main() static class LocaleVotingData { @@ -1117,7 +1218,10 @@ static ErrorType fromStatusString(String statusString) { } static class ErrorFile { + /** cached error for later rethrow */ + public static Throwable writeError = null; + public static String lastBaseLanguage = ""; private static final boolean SHOW_VOTING_INFO = false; public static CLDRFile voteFile; public static Factory voteFactory; @@ -1545,7 +1649,7 @@ private static void showSummary(String localeID, Level level, String value) { } private static void showExamples( - CheckCLDR checkCldr, + CLDRFile cldrFile, String prettyPath, String localeID, String path, @@ -1554,7 +1658,7 @@ private static void showExamples( String example) { if (example != null) { showValue( - checkCldr.getCldrFileToCheck(), + cldrFile, prettyPath, localeID, example,