[ https://issues.apache.org/jira/browse/MNG-8150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17853648#comment-17853648 ]
ASF GitHub Bot commented on MNG-8150: ------------------------------------- pshevche opened a new pull request, #1575: URL: https://github.com/apache/maven/pull/1575 ## Summary The PR address two issues observed in the `SimplexTransferListener` and `ConsoleMavenTransferListener`: 1. [TransferResource#getFile()](https://github.com/apache/maven-resolver/blob/master/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java#L170) can be null. The current `SimplexTransferListener` will break with an NPE if the `file` is not set on the resource. 2. `TransferResource` is not immutable and does not implement `equals` or `hashCode,` making its usage in collections brittle. Listener consumers are not guaranteed to reuse the same instance across listener invocations. I suggest wrapping it in an immutable identifier. Let me know if I am overthinking this or if anything else is needed. Resolves https://issues.apache.org/jira/browse/MNG-8150 - [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) > 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)