maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r809325 - in /maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver: CumulativeScopeArtifactFilter.java DefaultProjectDependenciesResolver.java
Date Sun, 30 Aug 2009 12:45:34 GMT
Author: bentmann
Date: Sun Aug 30 12:45:33 2009
New Revision: 809325

URL: http://svn.apache.org/viewvc?rev=809325&view=rev
Log:
o Refactored code

Modified:
    maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/CumulativeScopeArtifactFilter.java
    maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/DefaultProjectDependenciesResolver.java

Modified: maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/CumulativeScopeArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/CumulativeScopeArtifactFilter.java?rev=809325&r1=809324&r2=809325&view=diff
==============================================================================
--- maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/CumulativeScopeArtifactFilter.java
(original)
+++ maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/CumulativeScopeArtifactFilter.java
Sun Aug 30 12:45:33 2009
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.util.Collection;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
@@ -61,7 +63,23 @@
     {
         addScope( scope );
     }
-    
+
+    /**
+     * Create a new filter with the specified scopes and their implied scopes enabled.
+     * 
+     * @param scopes The scopes to enable, along with all implied scopes, may be {@code null}.
+     */
+    CumulativeScopeArtifactFilter( Collection<String> scopes )
+    {
+        if ( scopes != null )
+        {
+            for ( String scope : scopes )
+            {
+                addScope( scope );
+            }
+        }
+    }
+
     /**
      * Enable a new scope, along with its implied scopes, in this filter.
      * @param scope The scope to enable, along with all implied scopes.

Modified: maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/DefaultProjectDependenciesResolver.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/DefaultProjectDependenciesResolver.java?rev=809325&r1=809324&r2=809325&view=diff
==============================================================================
--- maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/DefaultProjectDependenciesResolver.java
(original)
+++ maven/shared/trunk/maven-artifact-resolver/src/main/java/org/apache/maven/shared/artifact/resolver/DefaultProjectDependenciesResolver.java
Sun Aug 30 12:45:33 2009
@@ -93,19 +93,8 @@
         {
             return resolved;
         }
-        
-        CumulativeScopeArtifactFilter scopeFilter = new CumulativeScopeArtifactFilter();
-        if ( scopes == null )
-        {
-            scopeFilter.addScope( Artifact.SCOPE_COMPILE );
-        }
-        else
-        {
-            for ( String scope : scopes )
-            {
-                scopeFilter.addScope( scope );
-            }
-        }
+
+        CumulativeScopeArtifactFilter scopeFilter = new CumulativeScopeArtifactFilter( scopes
);
         
         for ( MavenProject project : projects )
         {



Mime
View raw message