[MNG-5702] Wrong reactor summary output while using -T option

Changing into a better solution which doesn't change the
 implemented type of Map but use a synchronized one.
This commit is contained in:
Karl Heinz Marbaise 2014-12-31 11:25:55 +01:00
parent c407a4f7e7
commit cb91332d3d
1 changed files with 3 additions and 5 deletions

View File

@ -20,16 +20,14 @@ package org.apache.maven.execution;
*/
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.maven.project.DependencyResolutionResult;
import org.apache.maven.project.MavenProject;
import com.google.common.collect.Maps;
/** @author Jason van Zyl */
public class DefaultMavenExecutionResult
implements MavenExecutionResult
@ -42,7 +40,7 @@ public class DefaultMavenExecutionResult
private List<Throwable> exceptions = new CopyOnWriteArrayList<Throwable>();
private Map<MavenProject, BuildSummary> buildSummaries = Maps.newConcurrentMap();
private Map<MavenProject, BuildSummary> buildSummaries = Collections.synchronizedMap(new IdentityHashMap<MavenProject, BuildSummary>());
public MavenExecutionResult setProject( MavenProject project )
{
@ -107,7 +105,7 @@ public class DefaultMavenExecutionResult
{
if ( buildSummaries == null )
{
buildSummaries = new ConcurrentHashMap<MavenProject, BuildSummary>();
buildSummaries = Collections.synchronizedMap(new IdentityHashMap<MavenProject, BuildSummary>());
}
buildSummaries.put( summary.getProject(), summary );
}