You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/05/25 08:31:47 UTC

[GitHub] [maven] rfscholte commented on a change in pull request #342: [MNG-5760] Add --resume / -r switch

rfscholte commented on a change in pull request #342:
URL: https://github.com/apache/maven/pull/342#discussion_r429804991



##########
File path: maven-core/src/main/java/org/apache/maven/DefaultMaven.java
##########
@@ -366,20 +366,21 @@ private void afterSessionEnd( Collection<MavenProject> projects, MavenSession se
 
     private void saveResumptionDataWhenApplicable( MavenExecutionResult result, MavenSession session )
     {
-        List<LifecycleExecutionException> lifecycleExecutionExceptions = result.getExceptions().stream()
+        long lifecycleExecutionExceptionCount = result.getExceptions().stream()
                 .filter( LifecycleExecutionException.class::isInstance )
-                .map( LifecycleExecutionException.class::cast )
-                .collect( Collectors.toList() );
+                .count();

Review comment:
       The next codeblock needs to know if there were lifecycleExecutionException. That said, the amount doesn't matter, a simple `boolean` would be sufficient. A count needs to loop over all exceptions, whereas replacing `filter` with `anyMatch` would be the optimized implementation.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org