Skip to content

Commit 55475d3

Browse files
committed
Fix a ConcurrentModificationException.
The exception was observed in the integration tests of Maven Compiler Plugin when Maven is executed with the `-T4` option.
1 parent f067325 commit 55475d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
import java.io.IOException;
2222
import java.nio.file.Path;
2323
import java.util.Collection;
24-
import java.util.HashMap;
2524
import java.util.List;
2625
import java.util.Map;
2726
import java.util.Objects;
2827
import java.util.Set;
28+
import java.util.concurrent.ConcurrentHashMap;
2929
import java.util.function.Predicate;
3030
import java.util.stream.Collectors;
3131

@@ -85,7 +85,7 @@ public class DefaultDependencyResolver implements DependencyResolver {
8585
*/
8686
public DefaultDependencyResolver() {
8787
// TODO: the cache should not be instantiated here, but should rather be session-wide.
88-
moduleCaches = new HashMap<>();
88+
moduleCaches = new ConcurrentHashMap<>();
8989
}
9090

9191
/**

0 commit comments

Comments
 (0)