Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ConcurrentModificationException on mass Ant project open. #7989

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -889,7 +890,11 @@ private String mergePaths(Set<String> cnbs, boolean test,String testtype,File te
return cps.toString();
}

private static final Map<String, String> limitModulesCache = new HashMap<>();
/**
* cache shared between Evaluator instances.
*/
private static final Map<String, String> limitModulesCache = new ConcurrentHashMap<>();

private static String getLimitModules(String javacRelease) {
return limitModulesCache.computeIfAbsent(javacRelease, release -> {
Comment on lines +893 to 899
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on second thought: this probably could be a plain old synchronized map? The keys are javac release versions, so it won't use the per-item lock feature of the CMH very often.

int maxSupportedSourceVersion = SourceVersion.latest().ordinal();
Expand Down
Loading