From 87d8d34d4a11f28c5e27db543fb1385900589df6 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 27 Aug 2011 13:33:19 +0000 Subject: [PATCH] prevent ConcurrentModificationException git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1162348 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/execution/DefaultMavenExecutionResult.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java index c00628319c..d2f8111fb7 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java +++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java @@ -24,6 +24,7 @@ import java.util.Collections; import java.util.IdentityHashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.CopyOnWriteArrayList; import org.apache.maven.project.DependencyResolutionResult; import org.apache.maven.project.MavenProject; @@ -38,7 +39,7 @@ public class DefaultMavenExecutionResult private DependencyResolutionResult dependencyResolutionResult; - private List exceptions; + private List exceptions = new CopyOnWriteArrayList( ); private Map buildSummaries; @@ -85,11 +86,6 @@ public class DefaultMavenExecutionResult public MavenExecutionResult addException( Throwable t ) { - if ( exceptions == null ) - { - exceptions = new ArrayList(); - } - exceptions.add( t ); return this;