This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
commit 9c1182d7fc96178e0008c28c68fa30068c712291 Author: Guillaume Nodet <[email protected]> AuthorDate: Sun Jun 7 06:34:47 2026 +0000 Fix Results.addException/addCycle thread safety for parallelStream F-10: Synchronize addException() and addCycle() in Results to prevent data races when called concurrently from BfDependencyCollector's parallelStream during version range resolution. --- .../aether/internal/impl/collect/DependencyCollectorDelegate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java index a9d36745f..5c7b61320 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java @@ -568,7 +568,7 @@ public abstract class DependencyCollectorDelegate implements DependencyCollector return errorPath; } - public void addException(Dependency dependency, Exception e, List<DependencyNode> nodes) { + public synchronized void addException(Dependency dependency, Exception e, List<DependencyNode> nodes) { if (maxExceptions < 0 || result.getExceptions().size() < maxExceptions) { result.addException(e); if (errorPath == null) { @@ -591,7 +591,7 @@ public abstract class DependencyCollectorDelegate implements DependencyCollector } } - public void addCycle(List<DependencyNode> nodes, int cycleEntry, Dependency dependency) { + public synchronized void addCycle(List<DependencyNode> nodes, int cycleEntry, Dependency dependency) { if (maxCycles < 0 || result.getCycles().size() < maxCycles) { result.addCycle(new DefaultDependencyCycle(nodes, cycleEntry, dependency)); }
