From 4d33358be2e82c2b8f35e1a0ce241aff7da882bd Mon Sep 17 00:00:00 2001 From: Tibor17 Date: Fri, 2 Jan 2015 20:01:20 +0100 Subject: [PATCH] [MNG-5702] Final Fields on DefaultMavenExecutionResult.java --- .../maven/execution/DefaultMavenExecutionResult.java | 10 +++------- 1 file changed, 3 insertions(+), 7 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 b7599d23d4..708328a04d 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 @@ -38,9 +38,9 @@ public class DefaultMavenExecutionResult private DependencyResolutionResult dependencyResolutionResult; - private List exceptions = new CopyOnWriteArrayList(); + private final List exceptions = new CopyOnWriteArrayList(); - private Map buildSummaries = + private final Map buildSummaries = Collections.synchronizedMap( new IdentityHashMap() ); public MavenExecutionResult setProject( MavenProject project ) @@ -82,7 +82,7 @@ public class DefaultMavenExecutionResult public List getExceptions() { - return exceptions == null ? Collections.emptyList() : exceptions; + return exceptions; } public MavenExecutionResult addException( Throwable t ) @@ -104,10 +104,6 @@ public class DefaultMavenExecutionResult public void addBuildSummary( BuildSummary summary ) { - if ( buildSummaries == null ) - { - buildSummaries = Collections.synchronizedMap( new IdentityHashMap() ); - } buildSummaries.put( summary.getProject(), summary ); } }