Skip to content

Commit 5fcd56c

Browse files
authored
CLDR-16158 synchronize CheckCLDR in TestCache (#3772)
1 parent f2ab09e commit 5fcd56c

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tools/cldr-code/src/main/java/org/unicode/cldr/test/TestCache.java

+14-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ protected TestResultBundle(CheckCLDR.Options cldrOptions) {
4242
options = cldrOptions;
4343
pathCache = new ConcurrentHashMap<>();
4444
file = getFactory().make(options.getLocale().getBaseName(), true);
45-
cc.setCldrFileToCheck(file, options, possibleProblems);
45+
synchronized (cc) {
46+
cc.setCldrFileToCheck(file, options, possibleProblems);
47+
}
4648
}
4749

4850
/**
@@ -68,12 +70,14 @@ public void check(String path, List<CheckStatus> result, String value) {
6870
key,
6971
(Pair<String, String> k) -> {
7072
List<CheckStatus> l = new ArrayList<CheckStatus>();
71-
cc.check(
72-
k.getFirst(),
73-
file.getFullXPath(k.getFirst()),
74-
k.getSecond(),
75-
options,
76-
l);
73+
synchronized (cc) {
74+
cc.check(
75+
k.getFirst(),
76+
file.getFullXPath(k.getFirst()),
77+
k.getSecond(),
78+
options,
79+
l);
80+
}
7781
return l;
7882
});
7983
if (cachedResult != null) {
@@ -82,7 +86,9 @@ public void check(String path, List<CheckStatus> result, String value) {
8286
}
8387

8488
public void getExamples(String path, String value, List<CheckStatus> result) {
85-
cc.getExamples(path, file.getFullXPath(path), value, options, result);
89+
synchronized (cc) {
90+
cc.getExamples(path, file.getFullXPath(path), value, options, result);
91+
}
8692
}
8793

8894
public List<CheckStatus> getPossibleProblems() {

0 commit comments

Comments
 (0)