cstamas commented on code in PR #201:
URL: https://github.com/apache/maven-resolver/pull/201#discussion_r995933797


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/checksum/SummaryFileTrustedChecksumsSource.java:
##########
@@ -201,41 +214,38 @@ private String calculateSummaryPath( boolean originAware,
         return fileName + "." + checksumAlgorithmFactory.getFileExtension();
     }
 
-    /**
-     * Note: this implementation will work only in single-thread (T1) model. 
While not ideal, the "workaround" is
-     * possible in both, Maven and Maven Daemon: force single threaded 
execution model while "recording" (in mvn:
-     * do not pass any {@code -T} CLI parameter, while for mvnd use {@code -1} 
CLI parameter.
-     * 
-     * TODO: this will need to be reworked for at least two reasons: a) avoid 
duplicates in summary file and b)
-     * support multi threaded builds (probably will need "on session close" 
hook).
-     */
     private class SummaryFileWriter implements Writer
     {
         private final Path basedir;
 
         private final boolean originAware;
 
-        private SummaryFileWriter( Path basedir, boolean originAware )
+        private final ConcurrentHashMap<Path, Set<String>> recordedLines;
+
+        private SummaryFileWriter( Path basedir,
+                                   boolean originAware,
+                                   ConcurrentHashMap<Path, Set<String>> 
recordedLines )

Review Comment:
   To avoid duplications, as artifacts like plexus-utils are going thru 
resolver many times... (in essence, it uses set while "accumulating" to avoid 
duplicates which is better for memory as well, as in gather all in a list, and 
dedupe at save)



-- 
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