From e778ea67121f17232a7dced3fb4f0a205ffa64af Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Wed, 18 Jul 2012 01:16:59 +0000 Subject: [PATCH] MNG-5312: MavenProject.getParent intolerably slow when import scope used heavily Submitted by: Jesse Glick git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1362736 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/project/DefaultProjectBuilder.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index 19a3dd51a2..4e4db80d4b 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -99,13 +99,13 @@ public class DefaultProjectBuilder public ProjectBuildingResult build( File pomFile, ProjectBuildingRequest request ) throws ProjectBuildingException { - return build( pomFile, new FileModelSource( pomFile ), new InternalConfig( request, null, null ) ); + return build( pomFile, new FileModelSource( pomFile ), new InternalConfig( request, null ) ); } public ProjectBuildingResult build( ModelSource modelSource, ProjectBuildingRequest request ) throws ProjectBuildingException { - return build( null, modelSource, new InternalConfig( request, null, null ) ); + return build( null, modelSource, new InternalConfig( request, null ) ); } private ProjectBuildingResult build( File pomFile, ModelSource modelSource, InternalConfig config ) @@ -256,7 +256,7 @@ public class DefaultProjectBuilder request.setUserProperties( configuration.getUserProperties() ); request.setBuildStartTime( configuration.getBuildStartTime() ); request.setModelResolver( resolver ); - request.setModelCache( config.modelCache ); + request.setModelCache( new ReactorModelCache() ); return request; } @@ -273,7 +273,7 @@ public class DefaultProjectBuilder org.sonatype.aether.artifact.Artifact pomArtifact = RepositoryUtils.toArtifact( artifact ); pomArtifact = ArtifactDescriptorUtils.toPomArtifact( pomArtifact ); - InternalConfig config = new InternalConfig( request, null, null ); + InternalConfig config = new InternalConfig( request, null ); boolean localProject; @@ -334,9 +334,7 @@ public class DefaultProjectBuilder ReactorModelPool modelPool = new ReactorModelPool(); - ReactorModelCache modelCache = new ReactorModelCache(); - - InternalConfig config = new InternalConfig( request, modelPool, modelCache ); + InternalConfig config = new InternalConfig( request, modelPool ); Map projectIndex = new HashMap( 256 ); @@ -673,13 +671,10 @@ public class DefaultProjectBuilder public final ReactorModelPool modelPool; - public final ReactorModelCache modelCache; - - public InternalConfig( ProjectBuildingRequest request, ReactorModelPool modelPool, ReactorModelCache modelCache ) + InternalConfig( ProjectBuildingRequest request, ReactorModelPool modelPool ) { this.request = request; this.modelPool = modelPool; - this.modelCache = modelCache; session = LegacyLocalRepositoryManager.overlay( request.getLocalRepository(), request.getRepositorySession(), repoSystem );