Remove checked in patch.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@699874 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2008-09-28 18:20:33 +00:00
parent c208511348
commit 90c71d6b73
1 changed files with 0 additions and 94 deletions

94
c.patch
View File

@ -1,94 +0,0 @@
Index: maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
===================================================================
--- maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java (revision 697955)
+++ maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java (working copy)
@@ -46,11 +46,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
/**
* Default implementation of the project builder.
@@ -72,6 +68,8 @@
private RepositoryHelper repositoryHelper;
+ private HashMap<String, PomClassicDomainModel> cache = new HashMap<String, PomClassicDomainModel>();
+
/**
* Default constructor
*/
@@ -139,6 +137,12 @@
}
PomClassicDomainModel domainModel = new PomClassicDomainModel( pom );
+ if(cache.containsKey(domainModel.getId()))
+ {
+ // System.out.println("CACHE: " + domainModel.getId());
+ return createMavenProject(cache.get(domainModel.getId()), projectBuilderConfiguration);
+ }
+
domainModel.setProjectDirectory( projectDirectory );
List<DomainModel> domainModels = new ArrayList<DomainModel>();
@@ -181,12 +185,21 @@
transformer,
importModels,
properties ) );
+ transformedDomainModel.setParentFile(parentFile);
+ cache.put(domainModel.getId(), transformedDomainModel);
+ //System.out.println("CACHE SIZE = " + cache.size());
+ return createMavenProject(transformedDomainModel, projectBuilderConfiguration);
+ }
+
+
+ private MavenProject createMavenProject(PomClassicDomainModel domainModel, ProjectBuilderConfiguration config)
+ throws IOException
+ {
try
{
- MavenProject mavenProject = new MavenProject( transformedDomainModel.getModel(), artifactFactory,
- mavenTools, null,
- projectBuilderConfiguration );
- mavenProject.setParentFile( parentFile );
+ MavenProject mavenProject = new MavenProject( domainModel.getModel(), artifactFactory, mavenTools, null,
+ config );
+ mavenProject.setParentFile( domainModel.getParentFile() );
return mavenProject;
}
catch ( InvalidRepositoryException e )
@@ -240,7 +253,7 @@
Artifact artifactParent =
artifactFactory.createParentArtifact( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
- artifactResolver.resolve( artifactParent );
+ // artifactParent = artifactResolver.resolve( artifactParent );
PomClassicDomainModel parentDomainModel = new PomClassicDomainModel( artifactParent.getFile() );
if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) )
@@ -249,17 +262,12 @@
": Child ID = " + domainModel.getModel().getId() );
return domainModels;
}
- else
- {
- // logger.info("Adding pom to hierarchy: Group Id = " + parent.getGroupId() + ", Artifact Id ="
- // + parent.getArtifactId() + ", Version = " + parent.getVersion() + ", File" + artifactParent.getFile());
- }
-
+ cache.put(parentDomainModel.getId(), parentDomainModel);
domainModels.add( parentDomainModel );
domainModels.addAll( getDomainModelParentsFromRepository( parentDomainModel, artifactResolver ) );
return domainModels;
}
-
+
/**
* Returns list of domain model parents of the specified domain model. The parent domain models are part
*