gnodet commented on code in PR #1902:
URL: https://github.com/apache/maven-resolver/pull/1902#discussion_r3419230244


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java:
##########
@@ -550,7 +550,7 @@ protected static class Results {
 
         final int maxCycles;
 
-        String errorPath;
+        volatile String errorPath;

Review Comment:
   `Results` is shared across threads during parallel dependency collection. 
`errorPath` is written by `addException()` (now synchronized) but was also read 
directly by field access. The `volatile` ensures visibility of writes to 
threads that read `errorPath` outside of the synchronized methods.



##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ChainedWorkspaceReader.java:
##########
@@ -38,7 +38,7 @@ public final class ChainedWorkspaceReader implements 
WorkspaceReader {
 
     private final List<WorkspaceReader> readers = new ArrayList<>();
 
-    private WorkspaceRepository repository;
+    private volatile WorkspaceRepository repository;

Review Comment:
   You are right — this change has been dropped from this PR. Your PR #1909 
handles it properly with `AtomicReference` and truly final `readers`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to