[ 
https://issues.apache.org/jira/browse/MNG-8150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854071#comment-17854071
 ] 

ASF GitHub Bot commented on MNG-8150:
-------------------------------------

gnodet commented on code in PR #1575:
URL: https://github.com/apache/maven/pull/1575#discussion_r1634977808


##########
maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java:
##########
@@ -35,7 +35,7 @@
  */
 public class ConsoleMavenTransferListener extends 
AbstractMavenTransferListener {
 
-    private Map<TransferResource, Long> transfers = new LinkedHashMap<>();
+    private Map<TransferResourceIdentifier, TransferResourceAndSize> transfers 
= new LinkedHashMap<>();
     private FileSizeFormat format = new FileSizeFormat(Locale.ENGLISH); // use 
in a synchronized fashion

Review Comment:
   We need to get rid of the `Locale.ENGLISH` parameter which is unused, though 
this can be done in a subsequent PR.



##########
maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java:
##########
@@ -35,7 +35,7 @@
  */
 public class ConsoleMavenTransferListener extends 
AbstractMavenTransferListener {
 
-    private Map<TransferResource, Long> transfers = new LinkedHashMap<>();
+    private Map<TransferResourceIdentifier, TransferResourceAndSize> transfers 
= new LinkedHashMap<>();

Review Comment:
   Those 3 fields should be `final`.



##########
maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java:
##########
@@ -35,7 +35,7 @@
  */
 public class ConsoleMavenTransferListener extends 
AbstractMavenTransferListener {

Review Comment:
   Can we add a comment specifying that this class is not thread safe and 
should only be used from a single thread, or wrapped in the 
`SimplexTransferListener` ?





> Make SimplexTransferListener handle absent source/target files
> --------------------------------------------------------------
>
>                 Key: MNG-8150
>                 URL: https://issues.apache.org/jira/browse/MNG-8150
>             Project: Maven
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 3.9.7
>            Reporter: Pavlo Shevchenko
>            Assignee: Tamas Cservenak
>            Priority: Minor
>             Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4
>
>
> See the discussion: 
> [https://github.com/apache/maven/pull/1471/files#r1632930409]
> The `TransferResource#file` may be `null`. The current implementation of the 
> `SimplexTransferListener` cannot handle this case and will break with an NPE.
>  
> The fix should be merged to `master` and backported to `maven-3.9.x` branches.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to