You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2025/05/03 09:26:44 UTC
Re: [PR] Pull #2287: `Modernize codebase with Java improvements - Use modern Java collections API (toList() instead of collect(Collectors.toList()))` [maven]
gnodet commented on code in PR #2287:
URL: https://github.com/apache/maven/pull/2287#discussion_r2072359212
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultChecksumAlgorithmService.java:
##########
@@ -75,9 +74,9 @@ public ChecksumAlgorithm select(String algorithmName) {
public Collection<ChecksumAlgorithm> select(Collection<String> algorithmNames) {
nonNull(algorithmNames, "algorithmNames");
try {
- return checksumAlgorithmFactorySelector.selectList(new ArrayList<>(algorithmNames)).stream()
+ return new ArrayList<>(checksumAlgorithmFactorySelector.selectList(new ArrayList<>(algorithmNames)).stream()
Review Comment:
This is wrong. If a mutable list is required, don't use `toList()`
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org