Skip to content

Commit

Permalink
Prevent concurrent modification in the comparison cache
Browse files Browse the repository at this point in the history
  • Loading branch information
seadowg committed Feb 15, 2024
1 parent 63fedf8 commit 09a8a95
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public List<TreeReference> filter(@NotNull DataInstance sourceInstance, @NotNull
}
}

private List<TreeReference> getCachedEvaluations(@NotNull Supplier<List<TreeReference>> next, String key) {
/**
* Synchronized to prevent two or more threads from modifying {@link #cachedEvaluations} at once
*/
private synchronized List<TreeReference> getCachedEvaluations(@NotNull Supplier<List<TreeReference>> next, String key) {
if (cachedEvaluations.containsKey(key)) {
return cachedEvaluations.get(key);
} else {
Expand Down

0 comments on commit 09a8a95

Please sign in to comment.