diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAlt.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAlt.java index 5aed63d39fc..226f84d8e36 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAlt.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAlt.java @@ -26,6 +26,8 @@ public CheckCLDR handleCheck( return this; } + if (!accept(result)) return this; + String strippedPath = CLDRFile.getNondraftNonaltXPath(path); if (strippedPath.equals(path)) { return this; // paths equal, skip @@ -48,7 +50,7 @@ public CheckCLDR handleCheck( } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; // Skip if the phase is not final testing @@ -59,7 +61,7 @@ public CheckCLDR setCldrFileToCheck( return this; } - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); seenSoFar.clear(); return this; } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAltOnly.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAltOnly.java index b573f576643..164b7fa2c1c 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAltOnly.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAltOnly.java @@ -40,6 +40,7 @@ public CheckCLDR handleCheck( if (file.getConstructedValue(nonAltPath) != null) { return this; } + if (!accept(result)) return this; /* * If the source locale is not code-fallback, it's not an error. * getSourceLocaleIdExtended with skipInheritanceMarker = false means that if the diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAnnotations.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAnnotations.java index 08510fdc8f9..7d346f33a9f 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAnnotations.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAnnotations.java @@ -18,6 +18,7 @@ public CheckCLDR handleCheck( || !getCldrFileToCheck().isNotRoot(path)) { return this; } + if (!accept(result)) return this; final String ecode = hasAnnotationECode(value); if (ecode != null) { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAttributeValues.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAttributeValues.java index 467fa30dc12..6b3c99805c8 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAttributeValues.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAttributeValues.java @@ -93,6 +93,7 @@ public CheckCLDR handleCheck( if (!getCldrFileToCheck().getLocaleID().equals(locale)) { return this; } + if (!accept(result)) return this; XPathParts parts = XPathParts.getFrozenInstance(fullPath); for (int i = 0; i < parts.size(); ++i) { if (parts.getAttributeCount(i) == 0) { @@ -280,7 +281,7 @@ String getReplacement(String value, String attributeValue) { LocaleIDParser localeIDParser = new LocaleIDParser(); @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; if (Phase.FINAL_TESTING == getPhase() || Phase.BUILD == getPhase()) { @@ -292,7 +293,7 @@ public CheckCLDR setCldrFileToCheck( pluralInfo = supplementalData.getPlurals(PluralType.cardinal, cldrFileToCheck.getLocaleID()); - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); isEnglish = "en".equals(localeIDParser.set(cldrFileToCheck.getLocaleID()).getLanguage()); synchronized (elementOrder) { if (!initialized) { 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 d98b42a0a94..1a7c35d8421 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 @@ -439,6 +439,7 @@ public Options() { public Options(Options options2) { this.options = Arrays.copyOf(options2.options, options2.options.length); this.key = options2.key; + this.locale = options2.locale; } public Options( @@ -650,36 +651,39 @@ public final CLDRFile getCldrFileToCheck() { } /** - * Don't override this, use the other setCldrFileToCheck which takes an Options instead of a - * Map<> + * Often subclassed for initializing. If so, make the first 2 lines: if (cldrFileToCheck == + * null) return this; super.handleSetCldrFileToCheck(cldrFileToCheck); do stuff + * + *

Called late via accept(). * * @param cldrFileToCheck * @param options - * @param possibleErrors + * @param possibleErrors any deferred possibleErrors can be set here. They will be appended to + * every handleCheck() call. * @return - * @see #setCldrFileToCheck(CLDRFile, Options, List) - * @deprecated */ - @Deprecated - public final CheckCLDR setCldrFileToCheck( - CLDRFile cldrFileToCheck, - Map options, - List possibleErrors) { - return setCldrFileToCheck(cldrFileToCheck, new Options(options), possibleErrors); + public CheckCLDR handleSetCldrFileToCheck( + CLDRFile cldrFileToCheck, Options options, List possibleErrors) { + + // nothing by default + return this; } /** - * Set the CLDRFile. Must be done before calling check. If null is called, just skip Often - * subclassed for initializing. If so, make the first 2 lines: if (cldrFileToCheck == null) - * return this; super.setCldrFileToCheck(cldrFileToCheck); do stuff + * Set the CLDRFile. Must be done before calling check. * * @param cldrFileToCheck * @param options (not currently used) - * @param possibleErrors TODO + * @param possibleErrors */ public CheckCLDR setCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { this.cldrFileToCheck = cldrFileToCheck; + reset(); + // clear the *cached* possible Errors. Not counting any set immediately by subclasses. + cachedPossibleErrors.clear(); + cachedOptions = new Options(options); + // we must load filters here, as they are used by check() // Shortlist error filters for this locale. loadFilters(); @@ -694,9 +698,58 @@ public CheckCLDR setCldrFileToCheck( } xpaths.add(filter.get2()); } + + // hook for checks that want to set possibleErrors early + handleCheckPossibleErrors(cldrFileToCheck, options, possibleErrors); + return this; } + /** override this if you want to return errors immediately when setCldrFileToCheck is called */ + protected void handleCheckPossibleErrors( + CLDRFile cldrFileToCheck, Options options, List possibleErrors) { + // nothing by default. + } + + /** override this if you want to reset state immediately when setCldrFileToCheck is called */ + protected void reset() { + initted = false; + } + + /** + * Subclasses must call this, after any skip calculation to indicate that an xpath is relevant + * to them. + * + * @param result out-parameter to contain any deferred errors + * @return false if test is skipped and should exit + */ + protected boolean accept(List result) { + if (!initted) { + if (this.cldrFileToCheck == null) { + throw new NullPointerException("accept() was called before setCldrFileToCheck()"); + } + // clear this again. + cachedPossibleErrors.clear(); + // call into the subclass + handleSetCldrFileToCheck(this.cldrFileToCheck, cachedOptions, cachedPossibleErrors); + initted = true; + } + // unconditionally append all cached possible errors + result.addAll(cachedPossibleErrors); + if (isSkipTest()) { + return false; + } + return true; + } + + /** has accept() been called since setCldrFileToCheck() was called? */ + boolean initted = false; + + /** cache of possible errors, for handleSetCldrFileToCheck */ + List cachedPossibleErrors = new ArrayList<>(); + + Options cachedOptions = null; + /** Status value returned from check */ public static class CheckStatus { public static final Type alertType = Type.Comment, @@ -1139,33 +1192,6 @@ public static void appendTitle(StringBuffer htmlMessage) { } } - /** - * Wraps the options in an Options and delegates. - * - * @param path Must be a distinguished path, such as what comes out of CLDRFile.iterator() - * @param fullPath Must be the full path - * @param value the value associated with the path - * @param options A set of test-specific options. Set these with code of the form:
- * options.put("CoverageLevel.localeType", "G0")
- * That is, the key is of the form ., and the value is of the form - * .
- * There is one general option; the following will select only the tests that should be run - * during this phase.
- * options.put("phase", Phase.); It can be used for new data entry. - * @param result - * @return - * @deprecated use CheckCLDR#check(String, String, String, Options, List) - */ - @Deprecated - public final CheckCLDR check( - String path, - String fullPath, - String value, - Map options, - List result) { - return check(path, fullPath, value, new Options(options), result); - } - /** * Checks the path/value in the cldrFileToCheck for correctness, according to some criterion. If * the path is relevant to the check, there is an alert or warning, then a CheckStatus is added @@ -1253,9 +1279,10 @@ protected CheckCLDR handleGetExamples( } /** - * This is what the subclasses override. If they ever use pathParts or fullPathParts, they need - * to call initialize() with the respective path. Otherwise they must NOT change pathParts or - * fullPathParts. + * This is what the subclasses override. + * + *

If a path is not applicable, exit early with return this; Once a path is + * applicable, call accept(result); to add deferred possible problems. * *

If something is found, a CheckStatus is added to result. This can be done multiple times * in one call, if multiple errors or warnings are found. The CheckStatus may return warnings, @@ -1268,8 +1295,6 @@ protected CheckCLDR handleGetExamples( * .setType(CheckStatus.errorType) * .setMessage("Value should be {0}", new Object[] { pattern })); * - * - * @param options TODO */ public abstract CheckCLDR handleCheck( String path, String fullPath, String value, Options options, List result); @@ -1308,6 +1333,9 @@ public CheckCLDR handleCheck( Options options, List result) { result.clear(); + + if (!accept(result)) return this; + // If we're being asked to run tests for an inheritance marker, then we need to change // it // to the "real" value first before running tests. Testing the value @@ -1380,15 +1408,15 @@ private void addError(List result, CheckCLDR item, Exception e) { } @Override - public CheckCLDR setCldrFileToCheck( + public void handleCheckPossibleErrors( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { ElapsedTimer testTime = null, testOverallTime = null; - if (cldrFileToCheck == null) return this; + if (cldrFileToCheck == null) return; boolean SHOW_TIMES = options.contains(Options.Option.SHOW_TIMES); setPhase(Phase.forString(options.get(Options.Option.phase))); if (SHOW_TIMES) testOverallTime = new ElapsedTimer("Test setup time for setCldrFileToCheck: {0}"); - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleCheckPossibleErrors(cldrFileToCheck, options, possibleErrors); possibleErrors.clear(); for (Iterator it = filteredCheckList.iterator(); it.hasNext(); ) { @@ -1413,7 +1441,6 @@ public CheckCLDR setCldrFileToCheck( } } if (SHOW_TIMES) System.out.println("Overall: " + testOverallTime + ": {0}"); - return this; } public Matcher getFilter() { @@ -1427,7 +1454,7 @@ public CompoundCheckCLDR setFilter(Matcher filter) { CheckCLDR item = it.next(); if (filter == null || filter.reset(item.getClass().getName()).matches()) { filteredCheckList.add(item); - item.setCldrFileToCheck(getCldrFileToCheck(), (Options) null, null); + item.handleSetCldrFileToCheck(getCldrFileToCheck(), (Options) null, null); } } return this; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCasing.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCasing.java index 652ae6cd926..c7adff47949 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCasing.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCasing.java @@ -29,10 +29,10 @@ public static Case forString(String input) { BreakIterator breaker = null; @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); uLocale = new ULocale(cldrFileToCheck.getLocaleID()); breaker = BreakIterator.getWordInstance(uLocale); return this; @@ -46,6 +46,7 @@ public CheckCLDR handleCheck( if (fullPath == null) return this; // skip paths that we don't have if (fullPath.indexOf("casing") < 0) return this; + if (!accept(result)) return this; // pick up the casing attributes from the full path XPathParts parts = XPathParts.getFrozenInstance(fullPath); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckChildren.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckChildren.java index 99bd685fbd4..7e8ff509c05 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckChildren.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckChildren.java @@ -11,7 +11,7 @@ import org.unicode.cldr.util.CldrUtility; import org.unicode.cldr.util.Factory; -public class CheckChildren extends FactoryCheckCLDR { +public class CheckChildren extends FactoryCheckCLDR { CLDRFile[] immediateChildren; Map tempSet = new HashMap<>(); @@ -22,15 +22,14 @@ public CheckChildren(Factory factory) { @Override public CheckCLDR handleCheck( String path, String fullPath, String value, Options options, List result) { - if (immediateChildren == null) return this; // skip - test isn't even relevant - if (isSkipTest()) return this; // disabled if (fullPath == null) return this; // skip paths that we don't have if (value == null) return this; // skip null values + if (!accept(result)) return this; + if (immediateChildren == null) return this; // skip - test isn't even relevant String winningValue = this.getCldrFileToCheck().getWinningValue(fullPath); if (!value.equals(winningValue)) { return this; // only run this test against winning values. } - // String current = getResolvedCldrFileToCheck().getStringValue(path); tempSet.clear(); for (int i = 0; i < immediateChildren.length; ++i) { @@ -63,7 +62,14 @@ public CheckCLDR handleCheck( } @Override - public CheckCLDR setCldrFileToCheck( + public void reset() { + super.reset(); + immediateChildren = null; // reset this beforehand + tempSet.clear(); + } + + @Override + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; if (cldrFileToCheck.getLocaleID().equals("root")) @@ -78,7 +84,7 @@ public CheckCLDR setCldrFileToCheck( } List iChildren = new ArrayList<>(); - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); CLDRLocale myLocale = CLDRLocale.getInstance(cldrFileToCheck.getLocaleID()); if (myLocale.getCountry() != null && myLocale.getCountry().length() == 2) { immediateChildren = null; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckConsistentCasing.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckConsistentCasing.java index 523f8cd18c0..e5743ed4c63 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckConsistentCasing.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckConsistentCasing.java @@ -47,10 +47,10 @@ public CheckConsistentCasing(Factory factory) { } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); locale = cldrFileToCheck.getLocaleID(); // get info about casing; note that this is done in two steps since // ScriptMetadata.getInfo() returns null, in some instances. @@ -89,6 +89,7 @@ public CheckCLDR handleCheck( String path, String fullPath, String value, Options options, List result) { // it helps performance to have a quick reject of most paths if (fullPath == null) return this; // skip paths that we don't have + if (!accept(result)) return this; // causes hasCasingInfo to be calculated if (!hasCasingInfo) return this; String locale2 = getCldrFileToCheck().getSourceLocaleID(path, null); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java index 92999cf6b69..a85603abd54 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java @@ -53,9 +53,7 @@ public CheckCoverage(Factory factory) { public CheckCLDR handleCheck( String path, String fullPath, String value, Options options, List result) { - if (isSkipTest()) { - return this; - } + if (!accept(result)) return this; CLDRFile resolvedCldrFileToCheck = getResolvedCldrFileToCheck(); @@ -124,7 +122,7 @@ public CheckCLDR handleCheck( } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; setSkipTest(true); @@ -148,7 +146,7 @@ public CheckCLDR setCldrFileToCheck( } if (options != null && options.get(Options.Option.CheckCoverage_skip) != null) return this; - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); if (localeID.equals(LocaleNames.ROOT)) return this; requiredLevel = options.getRequiredLevel(localeID); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCurrencies.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCurrencies.java index 29620471258..07e3f4bce54 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCurrencies.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCurrencies.java @@ -16,7 +16,7 @@ public CheckCLDR handleCheck( // it helps performance to have a quick reject of most paths if (fullPath == null) return this; // skip paths that we don't have if (path.indexOf("/currency") < 0 || path.indexOf("/symbol") < 0) return this; - + if (!accept(result)) return this; // parts.set(path); // normally you have to parse out a path to get the exact one, but in // this case the quick // reject suffices diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDates.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDates.java index 21cf228ac84..05508b39a4a 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDates.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDates.java @@ -168,10 +168,10 @@ public CheckDates(Factory factory) { } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); icuServiceBuilder.setCldrFile(getResolvedCldrFileToCheck()); // the following is a hack to work around a bug in ICU4J (the snapshot, not the released @@ -339,6 +339,8 @@ public CheckCLDR handleCheck( return this; } + if (!accept(result)) return this; + String sourceLocale = getCldrFileToCheck().getSourceLocaleID(path, status); if (!path.equals(status.pathWhereFound) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDisplayCollisions.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDisplayCollisions.java index 69014ceea11..9a8635548be 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDisplayCollisions.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDisplayCollisions.java @@ -334,6 +334,7 @@ public CheckCLDR handleCheck( || value.equals(CldrUtility.INHERITANCE_MARKER)) { return this; } + if (!accept(result)) return this; // find my type; bail if I don't have one. Type myType = Type.getType(path); @@ -804,10 +805,10 @@ private boolean isCodeFallback(String dpath) { // private Map nameToSubdivisionId = Collections.emptyMap(); @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); // pick up the 3 subdivisions // nameToSubdivisionId = // EmojiSubdivisionNames.getNameToSubdivisionPath(cldrFileToCheck.getLocaleID()); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckExemplars.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckExemplars.java index 1da8fdd73d9..bcaee5c1a65 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckExemplars.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckExemplars.java @@ -132,10 +132,10 @@ public CheckExemplars(Factory factory) { // Allowed[:script=common:][:script=inherited:][:alphabetic=false:] @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); String locale = cldrFileToCheck.getLocaleID(); isRoot = cldrFileToCheck.getLocaleID().equals("root"); col = ComparatorUtilities.getIcuCollator(new ULocale(locale), Collator.IDENTICAL); @@ -173,6 +173,7 @@ public CheckCLDR handleCheck( } return this; } + if (!accept(result)) return this; XPathParts oparts = XPathParts.getFrozenInstance(path); final String exemplarString = oparts.findAttributeValue("exemplarCharacters", "type"); ExemplarType type = diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForCopy.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForCopy.java index 4de0d596f79..398d0db0b70 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForCopy.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForCopy.java @@ -87,6 +87,7 @@ public CheckCLDR handleCheck( if (fullPath == null || path == null || value == null) { return this; // skip root, and paths that we don't have } + if (!accept(result)) return this; Failure failure = sameAsCodeOrEnglish(value, path, unresolvedFile, getCldrFileToCheck(), false); addFailure(result, failure); @@ -290,7 +291,7 @@ private void addFailure(List result, Failure failure) { } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) { @@ -316,7 +317,7 @@ public CheckCLDR setCldrFileToCheck( return this; } - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); return this; } } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForExemplars.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForExemplars.java index d67f147c7fe..b7379b3f176 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForExemplars.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForExemplars.java @@ -185,11 +185,11 @@ public Set transform(String source) { } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFile, Options options, List possibleErrors) { if (cldrFile == null) return this; skip = true; - super.setCldrFileToCheck(cldrFile, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFile, options, possibleErrors); if (cldrFile.getLocaleID().equals("root")) { return this; } @@ -295,6 +295,7 @@ public CheckCLDR handleCheck( String path, String fullPath, String value, Options options, List result) { if (fullPath == null) return this; // skip paths that we don't have if (value == null) return this; // skip values that we don't have ? + if (!accept(result)) return this; if (skip) return this; if (path == null) { throw new InternalCldrException("Empty path!"); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForInheritanceMarkers.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForInheritanceMarkers.java index 63018cc4271..d8e7d016543 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForInheritanceMarkers.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForInheritanceMarkers.java @@ -12,6 +12,7 @@ public CheckCLDR handleCheck( if (value == null) { return this; } + if (!accept(result)) return this; if (value.contains(CldrUtility.INHERITANCE_MARKER)) { result.add( diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckLogicalGroupings.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckLogicalGroupings.java index cba03a6999b..5d325393333 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckLogicalGroupings.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckLogicalGroupings.java @@ -33,9 +33,9 @@ public CheckLogicalGroupings(Factory factory) { } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); // skip the test unless we are at the top level, eg // test root, fr, sr_Latn, ... @@ -61,6 +61,7 @@ public CheckCLDR handleCheck( if (LogicalGrouping.isOptional(getCldrFileToCheck(), path)) { return this; } + if (!accept(result)) return this; new LogicalGroupChecker(this, path, value, result).run(); return this; } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckMetazones.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckMetazones.java index d929dc18150..815978f7d35 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckMetazones.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckMetazones.java @@ -18,6 +18,7 @@ public CheckCLDR handleCheck( if (fullPath == null) return this; // skip paths that we don't have if (value == null) return this; // skip empty values if (path.indexOf("/metazone") < 0) return this; + if (!accept(result)) return this; // we're simply going to test to make sure that metazone values don't contain any digits if (value.matches(".*\\p{Nd}.*")) { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNames.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNames.java index 5497d50acd0..81c0a40db85 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNames.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNames.java @@ -20,6 +20,7 @@ public CheckCLDR handleCheck( if (!YEARS_NOT_ALLOWED.matcher(path).matches() || !getCldrFileToCheck().isNotRoot(path)) { return this; } + if (!accept(result)) return this; Matcher matcher = RegexUtilities.PATTERN_3_OR_4_DIGITS.matcher(value); if (matcher.find()) { // If same as the code-fallback value (territories) then no error diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNew.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNew.java index 67b23f9bb9a..cf5193a1110 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNew.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNew.java @@ -18,12 +18,12 @@ public CheckNew(Factory factory) { } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) { return this; } - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); isRoot = "root".equals(cldrFileToCheck.getLocaleID()); return this; @@ -36,6 +36,7 @@ public CheckCLDR handleCheck( CLDRFile cldrFileToCheck = getCldrFileToCheck(); // don't check inherited values // first see if the value is inherited or not + if (!accept(result)) return this; if (!isRoot && value != null && AnnotationUtil.pathIsAnnotation(path) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNumbers.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNumbers.java index 31f38688cc2..50c20121e39 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNumbers.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckNumbers.java @@ -84,10 +84,10 @@ public CheckNumbers(Factory factory) { * calling the super. */ @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { if (cldrFileToCheck == null) return this; - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); icuServiceBuilder.setCldrFile(getResolvedCldrFileToCheck()); isPOSIX = cldrFileToCheck.getLocaleID().indexOf("POSIX") >= 0; SupplementalDataInfo supplementalData = @@ -130,6 +130,9 @@ public CheckCLDR handleCheck( if (fullPath == null || value == null) return this; // skip paths that we don't have + // TODO: could exclude more paths + if (!accept(result)) return this; + // Do a quick check on the currencyMatch, to make sure that it is a proper UnicodeSet if (path.indexOf("/currencyMatch") >= 0) { try { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckPersonNames.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckPersonNames.java index 65194916e1b..46f521d841d 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckPersonNames.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckPersonNames.java @@ -52,7 +52,7 @@ public class CheckPersonNames extends CheckCLDR { new UnicodeSet("[\\p{sc=Kana}\\p{sc=Hira}]").addAll(HANI).freeze(); @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { String localeId = cldrFileToCheck.getLocaleID(); isRoot = localeId.equals("root"); @@ -72,7 +72,7 @@ public CheckCLDR setCldrFileToCheck( cldrFileToCheck .getStringValue("//ldml/personNames/nativeSpaceReplacement") .isEmpty(); - return super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + return super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); } public UnicodeSet getUnicodeSetForScript(String script) { @@ -98,6 +98,7 @@ public CheckCLDR handleCheck( if (isRoot || !path.startsWith("//ldml/personNames/")) { return this; } + if (!accept(result)) return this; XPathParts parts = XPathParts.getFrozenInstance(path); switch (parts.getElement(2)) { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckPlaceHolders.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckPlaceHolders.java index 90a79058800..ee20a6fcbdb 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckPlaceHolders.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckPlaceHolders.java @@ -72,9 +72,9 @@ public class CheckPlaceHolders extends CheckCLDR { private Set allowedModifiers = null; @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); allowedModifiers = Modifier.getAllowedModifiers(cldrFileToCheck.getLocaleID()); return this; } @@ -85,6 +85,8 @@ public CheckCLDR handleCheck( if (value == null || path.endsWith("/alias") || SKIP_PATH_LIST.matcher(path).matches()) { return this; } + // TODO: more skips here + if (!accept(result)) return this; if (path.contains("/personNames")) { XPathParts parts = XPathParts.getFrozenInstance(path); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckQuotes.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckQuotes.java index 07c3fa06a44..68347c3e90e 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckQuotes.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckQuotes.java @@ -31,6 +31,7 @@ public CheckCLDR handleCheck( } if (UNITS.matcher(path).matches()) { + if (!accept(result)) return this; Matcher matcher = ASCII_QUOTES.matcher(value); CheckStatus.Type type = CheckStatus.warningType; if (this.getCldrFileToCheck().getLocaleID().equals("en")) { @@ -47,6 +48,7 @@ public CheckCLDR handleCheck( } } if (DELIMITERS.matcher(path).matches()) { + if (!accept(result)) return this; if (!VALID_DELIMITERS.contains(value)) { result.add( new CheckStatus() diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckUnits.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckUnits.java index ce08aa7fc61..f7587652c08 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckUnits.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckUnits.java @@ -24,9 +24,9 @@ public class CheckUnits extends CheckCLDR { private Collection genders = null; @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); GrammarInfo grammarInfo = CLDRConfig.getInstance() @@ -50,6 +50,7 @@ public CheckCLDR handleCheck( if (value == null || !path.startsWith("//ldml/units")) { return this; } + if (!accept(result)) return this; final XPathParts parts = XPathParts.getFrozenInstance(path); String finalElement = parts.getElement(-1); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckWidths.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckWidths.java index 395925b735e..110bc377688 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckWidths.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckWidths.java @@ -497,6 +497,7 @@ public CheckCLDR handleCheck( if (value == null) { return this; // skip } + if (!accept(result)) return this; // String testPrefix = "//ldml/units/unitLength[@type=\"narrow\"]"; // if (path.startsWith(testPrefix)) { // int i = 0; @@ -533,14 +534,14 @@ public CheckCLDR handleCheck( } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { final String localeID = cldrFileToCheck.getLocaleID(); supplementalData = SupplementalDataInfo.getInstance(cldrFileToCheck.getSupplementalDirectory()); coverageLevel = CoverageLevel2.getInstance(supplementalData, localeID); - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); return this; } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckZones.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckZones.java index 8f2f58563d2..4ecb81ee784 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckZones.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckZones.java @@ -27,7 +27,7 @@ public CheckZones(Factory factory) { } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFile, Options options, List possibleErrors) { if (cldrFile == null) return this; // if (Phase.FINAL_TESTING == getPhase()) { @@ -37,7 +37,7 @@ public CheckCLDR setCldrFileToCheck( // return this; // } - super.setCldrFileToCheck(cldrFile, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFile, options, possibleErrors); try { timezoneFormatter = new TimezoneFormatter(getResolvedCldrFileToCheck()); } catch (RuntimeException e) { @@ -60,10 +60,9 @@ public CheckCLDR handleCheck( String path, String fullPath, String value, Options options, List result) { if (fullPath == null) return this; // skip paths that we don't have if (path.indexOf("timeZoneNames") < 0 || path.indexOf("usesMetazone") < 0) return this; + if (!accept(result)) return this; if (timezoneFormatter == null) { - if (true) return this; - throw new InternalCldrException( - "This should not occur: setCldrFileToCheck must create a TimezoneFormatter."); + return this; // error thrown above } XPathParts parts = XPathParts.getFrozenInstance(path); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/FactoryCheckCLDR.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/FactoryCheckCLDR.java index 8a40bb071e0..0b7367ee9a0 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/FactoryCheckCLDR.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/FactoryCheckCLDR.java @@ -52,9 +52,9 @@ public CLDRFile getResolvedCldrFileToCheck() { } @Override - public CheckCLDR setCldrFileToCheck( + public CheckCLDR handleSetCldrFileToCheck( CLDRFile cldrFileToCheck, Options options, List possibleErrors) { - super.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); + super.handleSetCldrFileToCheck(cldrFileToCheck, options, possibleErrors); resolvedCldrFileToCheck = null; return this; } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ConvertXTB.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ConvertXTB.java index c113b70865d..55ce86562ed 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ConvertXTB.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ConvertXTB.java @@ -17,6 +17,7 @@ import java.util.regex.Pattern; import org.unicode.cldr.test.CheckCLDR; import org.unicode.cldr.test.CheckCLDR.CheckStatus; +import org.unicode.cldr.test.CheckCLDR.CheckStatus.Type; import org.unicode.cldr.test.DisplayAndInputProcessor; import org.unicode.cldr.tool.Option.Options; import org.unicode.cldr.util.CLDRFile; @@ -469,7 +470,7 @@ private void check(XtbInfo xtbInfo) { } Map options = new HashMap<>(); List possibleErrors = new ArrayList<>(); - checkCldr.setCldrFileToCheck(cldrFile, options, possibleErrors); + checkCldr.setCldrFileToCheck(cldrFile, new CheckCLDR.Options(options), possibleErrors); for (CheckStatus status : possibleErrors) { System.out.println(locale + "\tLOCALE ERROR\t" + status.getMessage()); } @@ -478,7 +479,7 @@ private void check(XtbInfo xtbInfo) { String xpath = CLDRFile.getDistinguishingXPath(info.xpath, null); String fullPath = cldrFile.getFullXPath(xpath); String value = info.value; - checkCldr.check(xpath, fullPath, value, options, possibleErrors); + checkCldr.check(xpath, fullPath, value, new CheckCLDR.Options(options), possibleErrors); numErrors += displayErrors(locale, info.messageId, xpath, value, possibleErrors); } if (numErrors == 0) System.out.println("No errors found for " + locale); @@ -519,7 +520,7 @@ private int displayErrors( + status.getType() + "\t" + status.getMessage().replace('\t', ' ')); - if (status.getType().equals("Error")) { + if (status.getType().equals(Type.Error)) { numErrors++; } } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/SearchCLDR.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/SearchCLDR.java index e2edd391dcc..a10791a185e 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/SearchCLDR.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/SearchCLDR.java @@ -252,7 +252,7 @@ public static void main(String[] args) { int debug = 0; } result.clear(); - checkCldr.setCldrFileToCheck(resolvedFile, options, result); + checkCldr.setCldrFileToCheck(resolvedFile, new CheckCLDR.Options(options), result); } if (cldrDiffFactory != null) { @@ -331,7 +331,12 @@ public static void main(String[] args) { } result.clear(); - checkCldr.check(path, file.getFullXPath(path), value, options, result); + checkCldr.check( + path, + file.getFullXPath(path), + value, + new CheckCLDR.Options(options), + result); if (result.isEmpty()) { continue; } @@ -346,7 +351,12 @@ public static void main(String[] args) { } // for debugging int debug = 0; - checkCldr.check(path, file.getFullXPath(path), value, options, result); + checkCldr.check( + path, + file.getFullXPath(path), + value, + new CheckCLDR.Options(options), + result); } // made it through the sieve diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/VettingViewer.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/VettingViewer.java index d0e46c32ba6..9b81e7df7c3 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/VettingViewer.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/VettingViewer.java @@ -173,7 +173,7 @@ public Status initErrorStatus(CLDRFile cldrFile) { options = new HashMap<>(); result = new ArrayList<>(); checkCldr = CheckCLDR.getCheckAll(factory, ".*"); - checkCldr.setCldrFileToCheck(cldrFile, new Options(options), result); + checkCldr.handleSetCldrFileToCheck(cldrFile, new Options(options), result); return Status.ok; } diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckCLDR.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckCLDR.java index a0e60f89b92..8383b596f1b 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckCLDR.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckCLDR.java @@ -121,13 +121,13 @@ public static void TestCheckConsistentCasing() { Map options = new LinkedHashMap<>(); List possibleErrors = new ArrayList<>(); final CLDRFile english = testInfo.getEnglish(); - c.setCldrFileToCheck(english, options, possibleErrors); + c.setCldrFileToCheck(english, new CheckCLDR.Options(options), possibleErrors); for (String path : english) { c.check( path, english.getFullXPath(path), english.getStringValue(path), - options, + new CheckCLDR.Options(options), possibleErrors); } } @@ -595,7 +595,7 @@ void addExemplars( public void TestCheckNames() { CheckCLDR c = new CheckNames(); - Map options = new LinkedHashMap<>(); + Options options = new CheckCLDR.Options(new LinkedHashMap<>()); List possibleErrors = new ArrayList<>(); final CLDRFile english = testInfo.getEnglish(); c.setCldrFileToCheck(english, options, possibleErrors); @@ -652,7 +652,7 @@ public void checkCheckNew(String locale, String path, String expectedMessage) { CheckCLDR c = new CheckNew(testInfo.getCommonAndSeedAndMainAndAnnotationsFactory()); List result = new ArrayList<>(); - Map options = new HashMap<>(); + final CheckCLDR.Options options = new CheckCLDR.Options(new HashMap<>()); c.setCldrFileToCheck(testInfo.getCLDRFile(locale, true), options, result); c.check(path, path, "foobar", options, result); String actualMessage = ""; @@ -698,8 +698,8 @@ public void TestCheckNewRootFailure() { TestFactory currFactory = makeTestFactory(root, localeSource); CLDRFile cldrFile = currFactory.make(localeSource.getLocaleID(), true); - c.setCldrFileToCheck(cldrFile, options, result); - c.check(path, path, value, options, result); + c.setCldrFileToCheck(cldrFile, new CheckCLDR.Options(options), result); + c.check(path, path, value, new CheckCLDR.Options(options), result); boolean gotOne = false; for (CheckStatus status : result) { if (status.getSubtype() == Subtype.valueMustBeOverridden) { diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckDisplayCollisions.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckDisplayCollisions.java index d23bf840aa6..09cc8f1a22c 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckDisplayCollisions.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckDisplayCollisions.java @@ -239,13 +239,14 @@ public void checkDisplayCollisions( cdc.setEnglishFile(CLDRConfig.getInstance().getEnglish()); List possibleErrors = new ArrayList<>(); - cdc.setCldrFileToCheck(factory.make(locale, true), ImmutableMap.of(), possibleErrors); + cdc.setCldrFileToCheck( + factory.make(locale, true), new Options(ImmutableMap.of()), possibleErrors); for (Entry entry : pathValuePairs.entrySet()) { cdc.check( entry.getKey(), entry.getKey(), entry.getValue(), - ImmutableMap.of(), + new Options(ImmutableMap.of()), possibleErrors); assertEquals(entry.toString(), Collections.emptyList(), possibleErrors); } diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckNumbers.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckNumbers.java index 7578ebf9aaa..cf2ab82e60b 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckNumbers.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCheckNumbers.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; +import org.unicode.cldr.test.CheckCLDR; import org.unicode.cldr.test.CheckCLDR.CheckStatus; import org.unicode.cldr.test.CheckCLDR.CheckStatus.Subtype; import org.unicode.cldr.test.CheckCLDR.CheckStatus.Type; @@ -51,7 +51,7 @@ public void checkSingularity( xmlSource.setLocaleID(locale); CLDRFile cldrFileToCheck = new CLDRFile(xmlSource); - Map options = Collections.emptyMap(); + final CheckCLDR.Options options = new CheckCLDR.Options(Collections.emptyMap()); List possibleErrors = new ArrayList<>(); checkNumbers.setCldrFileToCheck(cldrFileToCheck, options, possibleErrors); assertEquals("setCldrFileToCheck", Collections.EMPTY_LIST, possibleErrors);