You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/06/20 08:40:21 UTC
[maven] 14/30: Replace Stream#filter#count with Stream#anyMatch
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MNG-5760
in repository https://gitbox.apache.org/repos/asf/maven.git
commit fdf3b09d63ef421dcd4f1c83b1a6a97122784ff3
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Mon May 25 15:39:50 2020 +0200
Replace Stream#filter#count with Stream#anyMatch
---
maven-core/src/main/java/org/apache/maven/DefaultMaven.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index a5e84f3..9f6c56f 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -366,11 +366,10 @@ public class DefaultMaven
private void saveResumptionDataWhenApplicable( MavenExecutionResult result, MavenSession session )
{
- long lifecycleExecutionExceptionCount = result.getExceptions().stream()
- .filter( LifecycleExecutionException.class::isInstance )
- .count();
+ boolean hasLifecycleExecutionExceptions = result.getExceptions().stream()
+ .anyMatch( LifecycleExecutionException.class::isInstance );
- if ( lifecycleExecutionExceptionCount > 0 )
+ if ( hasLifecycleExecutionExceptions )
{
session.getAllProjects().stream()
.filter( MavenProject::isExecutionRoot )