[MNG-5702] Final Fields on DefaultMavenExecutionResult.java

This commit is contained in:
Tibor17 2015-01-02 20:01:20 +01:00
parent 6f0318ed68
commit 4d33358be2
1 changed files with 3 additions and 7 deletions

View File

@ -38,9 +38,9 @@ public class DefaultMavenExecutionResult
private DependencyResolutionResult dependencyResolutionResult; private DependencyResolutionResult dependencyResolutionResult;
private List<Throwable> exceptions = new CopyOnWriteArrayList<Throwable>(); private final List<Throwable> exceptions = new CopyOnWriteArrayList<Throwable>();
private Map<MavenProject, BuildSummary> buildSummaries = private final Map<MavenProject, BuildSummary> buildSummaries =
Collections.synchronizedMap( new IdentityHashMap<MavenProject, BuildSummary>() ); Collections.synchronizedMap( new IdentityHashMap<MavenProject, BuildSummary>() );
public MavenExecutionResult setProject( MavenProject project ) public MavenExecutionResult setProject( MavenProject project )
@ -82,7 +82,7 @@ public class DefaultMavenExecutionResult
public List<Throwable> getExceptions() public List<Throwable> getExceptions()
{ {
return exceptions == null ? Collections.<Throwable>emptyList() : exceptions; return exceptions;
} }
public MavenExecutionResult addException( Throwable t ) public MavenExecutionResult addException( Throwable t )
@ -104,10 +104,6 @@ public class DefaultMavenExecutionResult
public void addBuildSummary( BuildSummary summary ) public void addBuildSummary( BuildSummary summary )
{ {
if ( buildSummaries == null )
{
buildSummaries = Collections.synchronizedMap( new IdentityHashMap<MavenProject, BuildSummary>() );
}
buildSummaries.put( summary.getProject(), summary ); buildSummaries.put( summary.getProject(), summary );
} }
} }