maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r632877 - in /maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer: DefaultProjectDependencyAnalyzer.java ProjectDependencyAnalysis.java
Date Sun, 02 Mar 2008 23:30:53 GMT
Author: brianf
Date: Sun Mar  2 15:30:52 2008
New Revision: 632877

URL: http://svn.apache.org/viewvc?rev=632877&view=rev
Log:
MDEP-150 deterministic analysis ordering

Modified:
    maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java
    maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java

Modified: maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java?rev=632877&r1=632876&r2=632877&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java
(original)
+++ maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java
Sun Mar  2 15:30:52 2008
@@ -23,9 +23,10 @@
 import java.io.IOException;
 import java.net.URL;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
 
@@ -76,13 +77,13 @@
             
             Set usedArtifacts = buildUsedArtifacts( artifactClassMap, dependencyClasses );
             
-            Set usedDeclaredArtifacts = new HashSet( declaredArtifacts );
+            Set usedDeclaredArtifacts = new LinkedHashSet( declaredArtifacts );
             usedDeclaredArtifacts.retainAll( usedArtifacts );
 
-            Set usedUndeclaredArtifacts = new HashSet( usedArtifacts );
+            Set usedUndeclaredArtifacts = new LinkedHashSet( usedArtifacts );
             usedUndeclaredArtifacts = removeAll( usedUndeclaredArtifacts, declaredArtifacts
);
 
-            Set unusedDeclaredArtifacts = new HashSet( declaredArtifacts );
+            Set unusedDeclaredArtifacts = new LinkedHashSet( declaredArtifacts );
             unusedDeclaredArtifacts = removeAll( unusedDeclaredArtifacts, usedArtifacts );
 
             return new ProjectDependencyAnalysis( usedDeclaredArtifacts, usedUndeclaredArtifacts,
@@ -107,7 +108,7 @@
      */
     private Set removeAll( Set start, Set remove )
     {
-        Set results = new HashSet( start.size() );
+        Set results = new LinkedHashSet( start.size() );
         Iterator iter = start.iterator();
         while ( iter.hasNext() )
         {
@@ -135,7 +136,7 @@
     private Map buildArtifactClassMap( MavenProject project )
         throws IOException
     {
-        Map artifactClassMap = new HashMap();
+        Map artifactClassMap = new LinkedHashMap();
 
         Set dependencyArtifacts = project.getArtifacts();
 

Modified: maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java?rev=632877&r1=632876&r2=632877&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java
(original)
+++ maven/shared/trunk/maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java
Sun Mar  2 15:30:52 2008
@@ -20,7 +20,7 @@
  */
 
 import java.util.Collections;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Set;
 
 /**
@@ -152,6 +152,6 @@
     
     private Set safeCopy( Set set )
     {
-        return ( set == null ) ? Collections.EMPTY_SET : Collections.unmodifiableSet( new
HashSet( set ) );
+        return ( set == null ) ? Collections.EMPTY_SET : Collections.unmodifiableSet( new
LinkedHashSet( set ) );
     }
 }



Mime
View raw message