diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/TestCache.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/TestCache.java index 724a13bfea1..4d4a249eb37 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/TestCache.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/TestCache.java @@ -42,7 +42,9 @@ protected TestResultBundle(CheckCLDR.Options cldrOptions) { options = cldrOptions; pathCache = new ConcurrentHashMap<>(); file = getFactory().make(options.getLocale().getBaseName(), true); - cc.setCldrFileToCheck(file, options, possibleProblems); + synchronized (cc) { + cc.setCldrFileToCheck(file, options, possibleProblems); + } } /** @@ -68,12 +70,14 @@ public void check(String path, List result, String value) { key, (Pair k) -> { List l = new ArrayList(); - cc.check( - k.getFirst(), - file.getFullXPath(k.getFirst()), - k.getSecond(), - options, - l); + synchronized (cc) { + cc.check( + k.getFirst(), + file.getFullXPath(k.getFirst()), + k.getSecond(), + options, + l); + } return l; }); if (cachedResult != null) { @@ -82,7 +86,9 @@ public void check(String path, List result, String value) { } public void getExamples(String path, String value, List result) { - cc.getExamples(path, file.getFullXPath(path), value, options, result); + synchronized (cc) { + cc.getExamples(path, file.getFullXPath(path), value, options, result); + } } public List getPossibleProblems() {