maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1400653 - in /maven/shared/trunk/maven-common-artifact-filters/src: main/java/org/apache/maven/shared/artifact/filter/ main/java/org/apache/maven/shared/artifact/filter/collection/ test/java/org/apache/maven/shared/artifact/filter/ test/ja...
Date Sun, 21 Oct 2012 14:18:02 GMT
Author: hboutemy
Date: Sun Oct 21 14:18:01 2012
New Revision: 1400653

URL: http://svn.apache.org/viewvc?rev=1400653&view=rev
Log:
added generics

Modified:
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StatisticsReportingArtifactFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactsFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactsFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/FilterArtifacts.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ProjectTransitivityFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ScopeFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilterTest.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternArtifactFilterTCK.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilterTest.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilterTest.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilterTest.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilterTest.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilterTest.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilterTestCase.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestArtifactFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestClassifierFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestFilterArtifacts.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestGroupIdFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestProjectTransitivityFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestScopeFilter.java
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestTypeFilter.java

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilter.java Sun Oct 21 14:18:01 2012
@@ -25,15 +25,12 @@ import org.apache.maven.artifact.version
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.artifact.versioning.VersionRange;
 
-import java.util.Iterator;
 import java.util.List;
 
 /**
  * Filter to include or exclude artifacts from a list of patterns. The artifact pattern syntax is of the form:
  * 
- * <pre>
- * [groupId]:[artifactId]:[type]:[version]
- * </pre>
+ * <pre>[groupId]:[artifactId]:[type]:[version]</pre>
  * 
  * <p>
  * Where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern
@@ -55,7 +52,7 @@ public abstract class AbstractStrictPatt
     /**
      * The list of artifact patterns to match, as described above.
      */
-    private final List patterns;
+    private final List<String> patterns;
 
     /**
      * Whether this filter should include or exclude artifacts that match the patterns.
@@ -74,7 +71,7 @@ public abstract class AbstractStrictPatt
      *            <code>true</code> to include artifacts that match the patterns, or <code>false</code> to exclude
      *            them
      */
-    public AbstractStrictPatternArtifactFilter( List patterns, boolean include )
+    public AbstractStrictPatternArtifactFilter( List<String> patterns, boolean include )
     {
         this.patterns = patterns;
         this.include = include;
@@ -89,13 +86,12 @@ public abstract class AbstractStrictPatt
     {
         boolean matched = false;
 
-        for ( Iterator i = patterns.iterator(); i.hasNext() & !matched; )
+        for ( String pattern : patterns )
         {
-            String pattern = (String) i.next();
-
             if ( include( artifact, pattern ) )
             {
                 matched = true;
+                break;
             }
         }
 

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilter.java Sun Oct 21 14:18:01 2012
@@ -1,3 +1,5 @@
+package org.apache.maven.shared.artifact.filter;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.shared.artifact.filter;
 
 import java.util.List;
 
@@ -31,12 +32,12 @@ import org.apache.maven.artifact.Artifac
 public class PatternExcludesArtifactFilter
     extends PatternIncludesArtifactFilter
 {
-    public PatternExcludesArtifactFilter( List patterns )
+    public PatternExcludesArtifactFilter( List<String> patterns )
     {
         super( patterns );
     }
 
-    public PatternExcludesArtifactFilter( List patterns, boolean actTransitively )
+    public PatternExcludesArtifactFilter( List<String> patterns, boolean actTransitively )
     {
         super( patterns, actTransitively );
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilter.java Sun Oct 21 14:18:01 2012
@@ -1,3 +1,5 @@
+package org.apache.maven.shared.artifact.filter;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,11 +18,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.shared.artifact.filter;
 
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -41,32 +41,30 @@ import org.codehaus.plexus.logging.Logge
 public class PatternIncludesArtifactFilter
     implements ArtifactFilter, StatisticsReportingArtifactFilter
 {
-    private final List positivePatterns;
+    private final List<String> positivePatterns;
 
-    private final List negativePatterns;
+    private final List<String> negativePatterns;
 
     private final boolean actTransitively;
 
-    private final Set patternsTriggered = new HashSet();
+    private final Set<String> patternsTriggered = new HashSet<String>();
 
-    private final List filteredArtifactIds = new ArrayList();
+    private final List<String> filteredArtifactIds = new ArrayList<String>();
 
-    public PatternIncludesArtifactFilter( final List patterns )
+    public PatternIncludesArtifactFilter( final List<String> patterns )
     {
         this( patterns, false );
     }
 
-    public PatternIncludesArtifactFilter( final List patterns, final boolean actTransitively )
+    public PatternIncludesArtifactFilter( final List<String> patterns, final boolean actTransitively )
     {
         this.actTransitively = actTransitively;
-        final List pos = new ArrayList();
-        final List neg = new ArrayList();
+        final List<String> pos = new ArrayList<String>();
+        final List<String> neg = new ArrayList<String>();
         if ( ( patterns != null ) && !patterns.isEmpty() )
         {
-            for ( final Iterator it = patterns.iterator(); it.hasNext(); )
+            for ( String pattern : patterns )
             {
-                final String pattern = (String) it.next();
-
                 if ( pattern.startsWith( "!" ) )
                 {
                     neg.add( pattern.substring( 1 ) );
@@ -128,7 +126,7 @@ public class PatternIncludesArtifactFilt
         }
     }
 
-    private boolean match( final Artifact artifact, final List patterns )
+    private boolean match( final Artifact artifact, final List<String> patterns )
     {
         final String shortId = ArtifactUtils.versionlessKey( artifact );
         final String id = artifact.getDependencyConflictId();
@@ -151,13 +149,13 @@ public class PatternIncludesArtifactFilt
 
         if ( actTransitively )
         {
-            final List depTrail = artifact.getDependencyTrail();
+            @SuppressWarnings( "unchecked" )
+            final List<String> depTrail = artifact.getDependencyTrail();
 
             if ( ( depTrail != null ) && depTrail.size() > 1 )
             {
-                for ( final Iterator iterator = depTrail.iterator(); iterator.hasNext(); )
+                for ( String trailItem : depTrail )
                 {
-                    final String trailItem = (String) iterator.next();
                     if ( matchAgainst( trailItem, patterns, true ) )
                     {
                         return true;
@@ -169,12 +167,10 @@ public class PatternIncludesArtifactFilt
         return false;
     }
 
-    private boolean matchAgainst( final String value, final List patterns, final boolean regionMatch )
+    private boolean matchAgainst( final String value, final List<String> patterns, final boolean regionMatch )
     {
-        for ( final Iterator iterator = patterns.iterator(); iterator.hasNext(); )
+        for ( String pattern : patterns )
         {
-            final String pattern = (String) iterator.next();
-
             final String[] patternTokens = pattern.split( ":" );
             final String[] tokens = value.split( ":" );
 
@@ -303,7 +299,7 @@ public class PatternIncludesArtifactFilt
         // if there are no patterns, there is nothing to report.
         if ( !positivePatterns.isEmpty() || !negativePatterns.isEmpty() )
         {
-            final List missed = new ArrayList();
+            final List<String> missed = new ArrayList<String>();
             missed.addAll( positivePatterns );
             missed.addAll( negativePatterns );
 
@@ -317,10 +313,8 @@ public class PatternIncludesArtifactFilt
                 buffer.append( getFilterDescription() );
                 buffer.append( ':' );
 
-                for ( final Iterator it = missed.iterator(); it.hasNext(); )
+                for ( String pattern : missed )
                 {
-                    final String pattern = (String) it.next();
-
                     buffer.append( "\no  \'" ).append( pattern ).append( "\'" );
                 }
 
@@ -340,10 +334,8 @@ public class PatternIncludesArtifactFilt
     protected String getPatternsAsString()
     {
         final StringBuffer buffer = new StringBuffer();
-        for ( final Iterator it = positivePatterns.iterator(); it.hasNext(); )
+        for ( String pattern : positivePatterns )
         {
-            final String pattern = (String) it.next();
-
             buffer.append( "\no \'" ).append( pattern ).append( "\'" );
         }
 
@@ -362,10 +354,8 @@ public class PatternIncludesArtifactFilt
             final StringBuffer buffer =
                 new StringBuffer( "The following artifacts were removed by this " + getFilterDescription() + ": " );
 
-            for ( final Iterator it = filteredArtifactIds.iterator(); it.hasNext(); )
+            for ( String artifactId : filteredArtifactIds )
             {
-                final String artifactId = (String) it.next();
-
                 buffer.append( '\n' ).append( artifactId );
             }
 
@@ -378,7 +368,7 @@ public class PatternIncludesArtifactFilt
         // if there are no patterns, there is nothing to report.
         if ( !positivePatterns.isEmpty() || !negativePatterns.isEmpty() )
         {
-            final List missed = new ArrayList();
+            final List<String> missed = new ArrayList<String>();
             missed.addAll( positivePatterns );
             missed.addAll( negativePatterns );
 

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilter.java Sun Oct 21 14:18:01 2012
@@ -1,3 +1,5 @@
+package org.apache.maven.shared.artifact.filter;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,10 +18,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.shared.artifact.filter;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.maven.artifact.Artifact;
@@ -63,7 +63,7 @@ public class ScopeArtifactFilter
 
     private boolean systemScopeHit = false;
 
-    private List filteredArtifactIds = new ArrayList();
+    private List<String> filteredArtifactIds = new ArrayList<String>();
     
     /**
      * Constructor that is meant to be used with fine-grained manipulation to 
@@ -172,10 +172,8 @@ public class ScopeArtifactFilter
         {
             StringBuffer buffer = new StringBuffer( "The following artifacts were removed by this filter: " );
 
-            for ( Iterator it = filteredArtifactIds.iterator(); it.hasNext(); )
+            for ( String artifactId : filteredArtifactIds )
             {
-                String artifactId = (String) it.next();
-
                 buffer.append( '\n' ).append( artifactId );
             }
 

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StatisticsReportingArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StatisticsReportingArtifactFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StatisticsReportingArtifactFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StatisticsReportingArtifactFilter.java Sun Oct 21 14:18:01 2012
@@ -1,3 +1,5 @@
+package org.apache.maven.shared.artifact.filter;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.shared.artifact.filter;
 
 import org.codehaus.plexus.logging.Logger;
 

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilter.java Sun Oct 21 14:18:01 2012
@@ -30,7 +30,8 @@ import java.util.List;
  * @see AbstractStrictPatternArtifactFilter
  * @see PatternExcludesArtifactFilter
  */
-public class StrictPatternExcludesArtifactFilter extends AbstractStrictPatternArtifactFilter
+public class StrictPatternExcludesArtifactFilter
+    extends AbstractStrictPatternArtifactFilter
 {
     /**
      * Creates a new filter that excludes artifacts that match the specified patterns.
@@ -38,7 +39,7 @@ public class StrictPatternExcludesArtifa
      * @param patterns
      *            the list of artifact patterns to match, as described above
      */
-    public StrictPatternExcludesArtifactFilter( List patterns )
+    public StrictPatternExcludesArtifactFilter( List<String> patterns )
     {
         super( patterns, false );
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilter.java Sun Oct 21 14:18:01 2012
@@ -30,7 +30,8 @@ import java.util.List;
  * @see AbstractStrictPatternArtifactFilter
  * @see PatternIncludesArtifactFilter
  */
-public class StrictPatternIncludesArtifactFilter extends AbstractStrictPatternArtifactFilter
+public class StrictPatternIncludesArtifactFilter
+    extends AbstractStrictPatternArtifactFilter
 {
     /**
      * Creates a new filter that includes artifacts that match the specified patterns.
@@ -38,7 +39,7 @@ public class StrictPatternIncludesArtifa
      * @param patterns
      *            the list of artifact patterns to match, as described above
      */
-    public StrictPatternIncludesArtifactFilter( List patterns )
+    public StrictPatternIncludesArtifactFilter( List<String> patterns )
     {
         super( patterns, true );
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilter.java Sun Oct 21 14:18:01 2012
@@ -21,7 +21,6 @@ package org.apache.maven.shared.artifact
 
 import java.util.Arrays;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -38,12 +37,12 @@ public abstract class AbstractArtifactFe
     extends AbstractArtifactsFilter
 {
     /** The list of types or classifiers to include */
-    private List includes;
+    private List<String> includes;
 
     /**
      * The list of types or classifiers to exclude (ignored if includes != null)
      */
-    private List excludes;
+    private List<String> excludes;
 
     public AbstractArtifactFeatureFilter( String include, String exclude)
     {
@@ -57,9 +56,9 @@ public abstract class AbstractArtifactFe
      * @param artifacts the set of dependencies to filter.
      * @return a Set of filtered dependencies.
      */
-    public Set filter( Set artifacts )
+    public Set<Artifact> filter( Set<Artifact> artifacts )
     {
-        Set results = artifacts;
+        Set<Artifact>results = artifacts;
 
         if ( this.includes != null && !this.includes.isEmpty() )
         {
@@ -81,19 +80,14 @@ public abstract class AbstractArtifactFe
      * @param theIncludes List of types or classifiers to include.
      * @return a set of filtered artifacts.
      */
-    private Set filterIncludes( Set artifacts, List theIncludes )
+    private Set<Artifact> filterIncludes( Set<Artifact> artifacts, List<String> theIncludes )
     {
-        Set result = new HashSet();
+        Set<Artifact> result = new HashSet<Artifact>();
 
-        Iterator includeIter = theIncludes.iterator();
-        while ( includeIter.hasNext() )
+        for ( String include : theIncludes )
         {
-            String include = (String) includeIter.next();
-            Iterator iter = artifacts.iterator();
-            while ( iter.hasNext() )
+            for ( Artifact artifact : artifacts )
             {
-                Artifact artifact = (Artifact) iter.next();
-
                 // if the classifier or type of the artifact
                 // matches the feature
                 // to include, add to the
@@ -114,24 +108,20 @@ public abstract class AbstractArtifactFe
      * @param excludes List of types or classifiers to exclude.
      * @return a set of filtered artifacts.
      */
-    private Set filterExcludes( Set artifacts, List theExcludes )
+    private Set<Artifact> filterExcludes( Set<Artifact> artifacts, List<String> theExcludes )
     {
-        Set result = new HashSet();
+        Set<Artifact> result = new HashSet<Artifact>();
 
-        Iterator iter = artifacts.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : artifacts )
         {
             boolean exclude = false;
-            Artifact artifact = (Artifact) iter.next();
             String artifactFeature = getArtifactFeature( artifact );
 
             // look through all types or classifiers. If no
             // matches are found
             // then it can be added to the results.
-            Iterator excludeIter = theExcludes.iterator();
-            while ( excludeIter.hasNext() )
+            for ( String excludeFeature : theExcludes )
             {
-                String excludeFeature = (String) excludeIter.next();
                 if ( compareFeatures( artifactFeature, excludeFeature ) )
                 {
                     exclude = true;
@@ -175,7 +165,7 @@ public abstract class AbstractArtifactFe
     /**
      * @return Returns the excludes.
      */
-    public List getExcludes()
+    public List<String> getExcludes()
     {
         return this.excludes;
     }
@@ -183,7 +173,7 @@ public abstract class AbstractArtifactFe
     /**
      * @return Returns the includes.
      */
-    public List getIncludes()
+    public List<String> getIncludes()
     {
         return this.includes;
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactsFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactsFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactsFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactsFilter.java Sun Oct 21 14:18:01 2012
@@ -34,7 +34,7 @@ public abstract class AbstractArtifactsF
      */
     public boolean isArtifactIncluded( Artifact artifact ) throws ArtifactFilterException
     {
-        Set set = new HashSet();
+        Set<Artifact> set = new HashSet<Artifact>();
         set.add( artifact );
 
         set = filter( set );

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java Sun Oct 21 14:18:01 2012
@@ -21,7 +21,6 @@ package org.apache.maven.shared.artifact
 
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -45,16 +44,17 @@ public class ArtifactTransitivityFilter
     extends AbstractArtifactsFilter
 {
 
-    Collection transitiveArtifacts;
+    Collection<Artifact> transitiveArtifacts;
 
     ArtifactFactory factory;
 
     ArtifactRepository local;
 
-    List remote;
+    List<ArtifactRepository> remote;
 
+    @SuppressWarnings( "unchecked" )
     public ArtifactTransitivityFilter( Artifact artifact, ArtifactFactory factory, ArtifactRepository local,
-                                       List remote, MavenProjectBuilder builder )
+                                       List<ArtifactRepository> remote, MavenProjectBuilder builder )
         throws ProjectBuildingException, InvalidDependencyVersionException
     {
         this.factory = factory;
@@ -73,8 +73,9 @@ public class ArtifactTransitivityFilter
 
     }
 
+    @SuppressWarnings( "unchecked" )
     public ArtifactTransitivityFilter( Dependency dependency, ArtifactFactory factory, ArtifactRepository local,
-                                       List remote, MavenProjectBuilder builder )
+                                       List<ArtifactRepository> remote, MavenProjectBuilder builder )
         throws ProjectBuildingException, InvalidDependencyVersionException
     {
 
@@ -95,14 +96,12 @@ public class ArtifactTransitivityFilter
 
     }
 
-    public Set filter( Set artifacts )
+    public Set<Artifact> filter( Set<Artifact> artifacts )
     {
 
-        Set result = new HashSet();
-        Iterator iterator = artifacts.iterator();
-        while ( iterator.hasNext() )
+        Set<Artifact> result = new HashSet<Artifact>();
+        for ( Artifact artifact : artifacts )
         {
-            Artifact artifact = (Artifact) iterator.next();
             if ( artifactIsATransitiveDependency( artifact ) )
             {
                 result.add( artifact );
@@ -120,12 +119,10 @@ public class ArtifactTransitivityFilter
     public boolean artifactIsATransitiveDependency( Artifact artifact )
     {
         boolean result = false;
-        Iterator iterator = transitiveArtifacts.iterator();
-        while ( iterator.hasNext() )
+        for ( Artifact trans : transitiveArtifacts )
         {
-            Artifact trans = (Artifact) iterator.next();
-            if ( trans.getGroupId().equals( artifact.getGroupId() ) &&
-                trans.getArtifactId().equals( artifact.getArtifactId() ) )
+            if ( trans.getGroupId().equals( artifact.getGroupId() )
+                && trans.getArtifactId().equals( artifact.getArtifactId() ) )
             {
                 result = true;
                 break;

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactsFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactsFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactsFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactsFilter.java Sun Oct 21 14:18:01 2012
@@ -33,7 +33,7 @@ import org.apache.maven.artifact.Artifac
  */
 public interface ArtifactsFilter
 {
-    Set filter( Set artifacts )
+    Set<Artifact> filter( Set<Artifact> artifacts )
         throws ArtifactFilterException;
 
     boolean isArtifactIncluded( Artifact artifact )

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/FilterArtifacts.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/FilterArtifacts.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/FilterArtifacts.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/FilterArtifacts.java Sun Oct 21 14:18:01 2012
@@ -24,20 +24,22 @@ package org.apache.maven.shared.artifact
  */
 
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Set;
 
+import org.apache.maven.artifact.Artifact;
+
 /**
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  * @version $Id$
  */
 public class FilterArtifacts
 {
-    private ArrayList filters = new ArrayList();
+    private List<ArtifactsFilter> filters;
 
     public FilterArtifacts()
     {
-        filters = new ArrayList();
+        filters = new ArrayList<ArtifactsFilter>();
     }
 
     /**
@@ -77,15 +79,13 @@ public class FilterArtifacts
         }
     }
 
-    public Set filter( Set artifacts )
+    public Set<Artifact> filter( Set<Artifact> artifacts )
         throws ArtifactFilterException
     {
         // apply filters
-        Iterator filterIterator = filters.iterator();
-        while ( filterIterator.hasNext() )
+        for ( ArtifactsFilter filter : filters )
         {
             // log(artifacts,log);
-            ArtifactsFilter filter = (ArtifactsFilter) filterIterator.next();
             try
             {
                 artifacts = filter.filter( artifacts );
@@ -103,7 +103,7 @@ public class FilterArtifacts
     /**
      * @return Returns the filters.
      */
-    public ArrayList getFilters()
+    public List<ArtifactsFilter> getFilters()
     {
         return this.filters;
     }
@@ -111,7 +111,7 @@ public class FilterArtifacts
     /**
      * @param filters The filters to set.
      */
-    public void setFilters( ArrayList filters )
+    public void setFilters( List<ArtifactsFilter> filters )
     {
         this.filters = filters;
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ProjectTransitivityFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ProjectTransitivityFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ProjectTransitivityFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ProjectTransitivityFilter.java Sun Oct 21 14:18:01 2012
@@ -20,7 +20,6 @@ package org.apache.maven.shared.artifact
  */
 
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -35,28 +34,26 @@ public class ProjectTransitivityFilter
 
     private boolean excludeTransitive;
 
-    private Set directDependencies;
+    private Set<Artifact> directDependencies;
 
-    public ProjectTransitivityFilter( Set directDependencies, boolean excludeTransitive )
+    public ProjectTransitivityFilter( Set<Artifact> directDependencies, boolean excludeTransitive )
     {
         this.excludeTransitive = excludeTransitive;
         this.directDependencies = directDependencies;
     }
 
-    public Set filter( Set artifacts )
+    public Set<Artifact> filter( Set<Artifact> artifacts )
     {
         // why not just take the directDependencies here?
         // because if this filter is run after some other process, the
         // set of artifacts may not be the same as the directDependencies.
-        Set result = artifacts;
+        Set<Artifact> result = artifacts;
 
         if ( excludeTransitive )
         {
-            result = new HashSet();
-            Iterator iterator = artifacts.iterator();
-            while ( iterator.hasNext() )
+            result = new HashSet<Artifact>();
+            for ( Artifact artifact : artifacts )
             {
-                Artifact artifact = (Artifact) iterator.next();
                 if ( artifactIsADirectDependency( artifact ) )
                 {
                     result.add( artifact );
@@ -74,18 +71,14 @@ public class ProjectTransitivityFilter
      */
     public boolean artifactIsADirectDependency( Artifact artifact )
     {
-        boolean result = false;
-        Iterator iterator = this.directDependencies.iterator();
-        while ( iterator.hasNext() )
+        for ( Artifact dependency : this.directDependencies )
         {
-            Artifact dependency = (Artifact) iterator.next();
             if ( dependency.equals( artifact ) )
             {
-                result = true;
-                break;
+                return true;
             }
         }
-        return result;
+        return false;
     }
 
     /**

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ScopeFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ScopeFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ScopeFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/collection/ScopeFilter.java Sun Oct 21 14:18:01 2012
@@ -20,10 +20,10 @@ package org.apache.maven.shared.artifact
  */
 
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
 import org.apache.maven.shared.utils.StringUtils;
 
@@ -55,10 +55,10 @@ public class ScopeFilter
      * @return a Set of filtered dependencies.
      * @throws ArtifactFilterException
      */
-    public Set filter( Set artifacts)
+    public Set<Artifact> filter( Set<Artifact> artifacts)
         throws ArtifactFilterException
     {
-        Set results = artifacts;
+        Set<Artifact> results = artifacts;
 
         if ( StringUtils.isNotEmpty( includeScope ) )
         {
@@ -69,7 +69,7 @@ public class ScopeFilter
                 throw new ArtifactFilterException( "Invalid Scope in includeScope: " + includeScope );
             }
 
-            results = new HashSet();
+            results = new HashSet<Artifact>();
 
             if ( Artifact.SCOPE_PROVIDED.equals( includeScope ) || Artifact.SCOPE_SYSTEM.equals( includeScope ) )
             {
@@ -77,12 +77,10 @@ public class ScopeFilter
             }
             else
             {
-                ScopeArtifactFilter saf = new ScopeArtifactFilter( includeScope );
+                ArtifactFilter saf = new ScopeArtifactFilter( includeScope );
 
-                Iterator iter = artifacts.iterator();
-                while ( iter.hasNext() )
+                for ( Artifact artifact : artifacts )
                 {
-                    Artifact artifact = (Artifact) iter.next();
                     if ( saf.include( artifact ) )
                     {
                         results.add( artifact );
@@ -98,7 +96,7 @@ public class ScopeFilter
             {
                 throw new ArtifactFilterException( "Invalid Scope in excludeScope: " + excludeScope );
             }
-            results = new HashSet();
+            results = new HashSet<Artifact>();
             // plexus ScopeArtifactFilter doesn't handle the provided scope so
             // we
             // need special handling for it.
@@ -108,12 +106,10 @@ public class ScopeFilter
             }
             else if ( !Artifact.SCOPE_PROVIDED.equals( excludeScope ) && !Artifact.SCOPE_SYSTEM.equals( excludeScope ) )
             {
-                ScopeArtifactFilter saf = new ScopeArtifactFilter( excludeScope );
+                ArtifactFilter saf = new ScopeArtifactFilter( excludeScope );
 
-                Iterator iter = artifacts.iterator();
-                while ( iter.hasNext() )
+                for ( Artifact artifact : artifacts )
                 {
-                    Artifact artifact = (Artifact) iter.next();
                     if ( !saf.include( artifact ) )
                     {
                         results.add( artifact );
@@ -129,13 +125,11 @@ public class ScopeFilter
         return results;
     }
 
-    private Set includeSingleScope( Set artifacts, String scope )
+    private Set<Artifact> includeSingleScope( Set<Artifact> artifacts, String scope )
     {
-        HashSet results = new HashSet();
-        Iterator iter = artifacts.iterator();
-        while ( iter.hasNext() )
+        Set<Artifact> results = new HashSet<Artifact>();
+        for ( Artifact artifact : artifacts )
         {
-            Artifact artifact = (Artifact) iter.next();
             if ( scope.equals( artifact.getScope() ) )
             {
                 results.add( artifact );
@@ -144,13 +138,11 @@ public class ScopeFilter
         return results;
     }
 
-    private Set excludeSingleScope( Set artifacts, String scope )
+    private Set<Artifact> excludeSingleScope( Set<Artifact> artifacts, String scope )
     {
-        HashSet results = new HashSet();
-        Iterator iter = artifacts.iterator();
-        while ( iter.hasNext() )
+        Set<Artifact> results = new HashSet<Artifact>();
+        for ( Artifact artifact : artifacts )
         {
-            Artifact artifact = (Artifact) iter.next();
             if ( !scope.equals( artifact.getScope() ) )
             {
                 results.add( artifact );

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilterTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilterTest.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilterTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilterTest.java Sun Oct 21 14:18:01 2012
@@ -403,7 +403,7 @@ public abstract class AbstractStrictPatt
      */
     protected void assertFilter( boolean expected, String pattern )
     {
-        List patterns = Collections.singletonList( pattern );
+        List<String> patterns = Collections.singletonList( pattern );
         AbstractStrictPatternArtifactFilter filter = createFilter( patterns );
 
         assertEquals( expected, filter.include( artifact ) );
@@ -416,5 +416,5 @@ public abstract class AbstractStrictPatt
      *            the list of artifact patterns that the filter should match
      * @return the filter to test
      */
-    protected abstract AbstractStrictPatternArtifactFilter createFilter( List patterns );
+    protected abstract AbstractStrictPatternArtifactFilter createFilter( List<String> patterns );
 }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternArtifactFilterTCK.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternArtifactFilterTCK.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternArtifactFilterTCK.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternArtifactFilterTCK.java Sun Oct 21 14:18:01 2012
@@ -1,3 +1,5 @@
+package org.apache.maven.shared.artifact.filter;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.shared.artifact.filter;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -36,9 +37,9 @@ public abstract class PatternArtifactFil
 
     private final MockManager mockManager = new MockManager();
 
-    protected abstract ArtifactFilter createFilter( List patterns );
+    protected abstract ArtifactFilter createFilter( List<String> patterns );
 
-    protected abstract ArtifactFilter createFilter( List patterns, boolean actTransitively );
+    protected abstract ArtifactFilter createFilter( List<String> patterns, boolean actTransitively );
 
     protected abstract boolean isInclusionExpected();
 
@@ -55,7 +56,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
         patterns.add( groupId1 + ":" + artifactId1 + ":*" );
         patterns.add( groupId2 + ":" + artifactId2 + ":*" );
 
@@ -88,7 +89,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
         patterns.add( groupId1 + "*" );
         patterns.add( groupId2 + "*" );
 
@@ -162,7 +163,7 @@ public abstract class PatternArtifactFil
         final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
 
         mockManager.replayAll();
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
 
         patterns.add( "otherGroup:" + artifactId + ":jar" );
         patterns.add( "otherGroup:" + artifactId );
@@ -190,7 +191,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
 
         patterns.add( groupId + "otherArtifact:jar" );
         patterns.add( groupId + "otherArtifact" );
@@ -218,7 +219,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
 
         patterns.add( "otherGroup:otherArtifact:jar" );
         patterns.add( "otherGroup:otherArtifact" );
@@ -245,8 +246,8 @@ public abstract class PatternArtifactFil
         final String rootDepTrailItem = "current:project:jar:1.0";
         final String depTrailItem = "otherGroup:otherArtifact";
 
-        final List depTrail = Arrays.asList( new String[] { rootDepTrailItem, depTrailItem + ":jar:1.0" } );
-        final List patterns = Collections.singletonList( depTrailItem );
+        final List<String> depTrail = Arrays.asList( new String[] { rootDepTrailItem, depTrailItem + ":jar:1.0" } );
+        final List<String> patterns = Collections.singletonList( depTrailItem );
 
         final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId, depTrail );
 
@@ -274,8 +275,8 @@ public abstract class PatternArtifactFil
         final String rootDepTrailItem = "current:project:jar:1.0";
         final String depTrailItem = "otherGroup:otherArtifact";
 
-        final List depTrail = Arrays.asList( new String[] { rootDepTrailItem, depTrailItem + ":jar:1.0" } );
-        final List patterns = Collections.singletonList( "otherGroup*" );
+        final List<String> depTrail = Arrays.asList( new String[] { rootDepTrailItem, depTrailItem + ":jar:1.0" } );
+        final List<String> patterns = Collections.singletonList( "otherGroup*" );
 
         final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId, depTrail );
 
@@ -304,7 +305,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
 
         patterns.add( "!group:artifact:jar" );
 
@@ -331,7 +332,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
 
         patterns.add( "group:*:jar" );
 
@@ -358,7 +359,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
 
         patterns.add( "*:artifact:*" );
 
@@ -385,7 +386,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
 
         patterns.add( "group:some-*-id" );
 
@@ -412,7 +413,7 @@ public abstract class PatternArtifactFil
 
         mockManager.replayAll();
 
-        final List patterns = new ArrayList();
+        final List<String> patterns = new ArrayList<String>();
 
         patterns.add( "some.group*" );
 
@@ -440,12 +441,12 @@ public abstract class PatternArtifactFil
         final String otherType = "ejb";
 
         final String depTrailItem = otherGroup + ":" + otherArtifact + ":" + otherType + ":version";
-        final List depTrail = Collections.singletonList( depTrailItem );
-        final List patterns = Collections.singletonList( "*:jar:*" );
+        final List<String> depTrail = Collections.singletonList( depTrailItem );
+        final List<String> patterns = Collections.singletonList( "*:jar:*" );
 
         final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId, "jar", depTrail );
         final ArtifactMockAndControl otherMac =
-            new ArtifactMockAndControl( otherGroup, otherArtifact, otherType, Collections.EMPTY_LIST );
+            new ArtifactMockAndControl( otherGroup, otherArtifact, otherType, Collections.<String> emptyList() );
 
         mockManager.replayAll();
 
@@ -513,17 +514,17 @@ public abstract class PatternArtifactFil
 
         String version;
 
-        List dependencyTrail;
+        List<String> dependencyTrail;
 
         String type;
 
-        ArtifactMockAndControl( final String groupId, final String artifactId, final List depTrail )
+        ArtifactMockAndControl( final String groupId, final String artifactId, final List<String> depTrail )
         {
             this( groupId, artifactId, "jar", depTrail );
         }
 
         ArtifactMockAndControl( final String groupId, final String artifactId, final String type,
-                                final List dependencyTrail )
+                                final List<String> dependencyTrail )
         {
             this.groupId = groupId;
             this.artifactId = artifactId;

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilterTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilterTest.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilterTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternExcludesArtifactFilterTest.java Sun Oct 21 14:18:01 2012
@@ -1,3 +1,5 @@
+package org.apache.maven.shared.artifact.filter;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.shared.artifact.filter;
 
 import java.util.List;
 
@@ -32,13 +33,13 @@ public class PatternExcludesArtifactFilt
     {
 
         @Override
-        protected ArtifactFilter createFilter( final List patterns )
+        protected ArtifactFilter createFilter( final List<String> patterns )
         {
             return new PatternExcludesArtifactFilter( patterns );
         }
 
         @Override
-        protected ArtifactFilter createFilter( final List patterns, final boolean actTransitively )
+        protected ArtifactFilter createFilter( final List<String> patterns, final boolean actTransitively )
         {
             return new PatternExcludesArtifactFilter( patterns, actTransitively );
         }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilterTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilterTest.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilterTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/PatternIncludesArtifactFilterTest.java Sun Oct 21 14:18:01 2012
@@ -1,3 +1,5 @@
+package org.apache.maven.shared.artifact.filter;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.shared.artifact.filter;
 
 import java.util.List;
 
@@ -31,13 +32,13 @@ public class PatternIncludesArtifactFilt
     {
 
         @Override
-        protected ArtifactFilter createFilter( final List patterns )
+        protected ArtifactFilter createFilter( final List<String> patterns )
         {
             return new PatternIncludesArtifactFilter( patterns );
         }
 
         @Override
-        protected ArtifactFilter createFilter( final List patterns, final boolean actTransitively )
+        protected ArtifactFilter createFilter( final List<String> patterns, final boolean actTransitively )
         {
             return new PatternIncludesArtifactFilter( patterns, actTransitively );
         }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilterTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilterTest.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilterTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilterTest.java Sun Oct 21 14:18:01 2012
@@ -1,3 +1,5 @@
+package org.apache.maven.shared.artifact.filter;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.shared.artifact.filter;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilterTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilterTest.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilterTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternExcludesArtifactFilterTest.java Sun Oct 21 14:18:01 2012
@@ -28,14 +28,15 @@ import java.util.List;
  * @version $Id$
  * @see StrictPatternExcludesArtifactFilter
  */
-public class StrictPatternExcludesArtifactFilterTest extends AbstractStrictPatternArtifactFilterTest
+public class StrictPatternExcludesArtifactFilterTest
+    extends AbstractStrictPatternArtifactFilterTest
 {
     // AbstractStrictPatternArtifactFilterTest methods ------------------------
 
     /*
      * @see org.apache.maven.shared.artifact.filter.AbstractStrictPatternArtifactFilterTest#createFilter(java.util.List)
      */
-    protected AbstractStrictPatternArtifactFilter createFilter( List patterns )
+    protected AbstractStrictPatternArtifactFilter createFilter( List<String> patterns )
     {
         return new StrictPatternExcludesArtifactFilter( patterns );
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilterTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilterTest.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilterTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/StrictPatternIncludesArtifactFilterTest.java Sun Oct 21 14:18:01 2012
@@ -28,14 +28,15 @@ import java.util.List;
  * @version $Id$
  * @see StrictPatternIncludesArtifactFilter
  */
-public class StrictPatternIncludesArtifactFilterTest extends AbstractStrictPatternArtifactFilterTest
+public class StrictPatternIncludesArtifactFilterTest
+    extends AbstractStrictPatternArtifactFilterTest
 {
     // AbstractStrictPatternArtifactFilterTest methods ------------------------
 
     /*
      * @see org.apache.maven.shared.artifact.filter.AbstractStrictPatternArtifactFilterTest#createFilter(java.util.List)
      */
-    protected AbstractStrictPatternArtifactFilter createFilter( List patterns )
+    protected AbstractStrictPatternArtifactFilter createFilter( List<String> patterns )
     {
         return new StrictPatternIncludesArtifactFilter( patterns );
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilterTestCase.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilterTestCase.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilterTestCase.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilterTestCase.java Sun Oct 21 14:18:01 2012
@@ -29,6 +29,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.maven.artifact.Artifact;
+
 import junit.framework.TestCase;
 
 /**
@@ -42,9 +44,9 @@ import junit.framework.TestCase;
 public abstract class AbstractArtifactFeatureFilterTestCase
     extends TestCase
 {
-    protected Set artifacts = new HashSet();
+    protected Set<Artifact> artifacts = new HashSet<Artifact>();
 
-    protected Class filterClass;
+    protected Class<?> filterClass;
 
     protected void setUp()
         throws Exception
@@ -53,14 +55,14 @@ public abstract class AbstractArtifactFe
 
     }
 
-    private Object createObjectViaReflection( Class clazz, Object[] conArgs )
+    private Object createObjectViaReflection( Class<?> clazz, Object[] conArgs )
         throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException,
         IllegalAccessException, InvocationTargetException
     {
-        Class[] argslist = new Class[2];
+        Class<?>[] argslist = new Class<?>[2];
         argslist[0] = String.class;
         argslist[1] = String.class;
-        Constructor ct = clazz.getConstructor( argslist );
+        Constructor<?> ct = clazz.getConstructor( argslist );
         return ct.newInstance( conArgs );
     }
 
@@ -75,8 +77,8 @@ public abstract class AbstractArtifactFe
 
         AbstractArtifactFeatureFilter filter =
             (AbstractArtifactFeatureFilter) createObjectViaReflection( filterClass, conArgs );
-        List includes = filter.getIncludes();
-        List excludes = filter.getExcludes();
+        List<String> includes = filter.getIncludes();
+        List<String> excludes = filter.getExcludes();
 
         assertEquals( 2, includes.size() );
         assertEquals( 2, excludes.size() );
@@ -89,14 +91,14 @@ public abstract class AbstractArtifactFe
     public abstract void testFiltering()
         throws Exception;
 
-    public Set filtering()
+    public Set<Artifact> filtering()
         throws SecurityException, IllegalArgumentException, NoSuchMethodException, InstantiationException,
         IllegalAccessException, InvocationTargetException
     {
         Object[] conArgs = new Object[] { "one,two", "one,three," };
         AbstractArtifactFeatureFilter filter =
             (AbstractArtifactFeatureFilter) createObjectViaReflection( filterClass, conArgs );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 1, result.size() );
         return result;
     }
@@ -104,14 +106,14 @@ public abstract class AbstractArtifactFe
     public abstract void testFiltering2()
         throws Exception;
 
-    public Set filtering2()
+    public Set<Artifact> filtering2()
         throws SecurityException, IllegalArgumentException, NoSuchMethodException, InstantiationException,
         IllegalAccessException, InvocationTargetException
     {
         Object[] conArgs = new Object[] { null, "one,three," };
         AbstractArtifactFeatureFilter filter =
             (AbstractArtifactFeatureFilter) createObjectViaReflection( filterClass, conArgs );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 2, result.size() );
         return result;
 
@@ -127,7 +129,7 @@ public abstract class AbstractArtifactFe
         Object[] conArgs = new Object[] { null, null };
         AbstractArtifactFeatureFilter filter =
             (AbstractArtifactFeatureFilter) createObjectViaReflection( filterClass, conArgs );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 4, result.size() );
     }
 }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestArtifactFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestArtifactFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestArtifactFilter.java Sun Oct 21 14:18:01 2012
@@ -23,7 +23,6 @@ package org.apache.maven.shared.artifact
  * 
  */
 
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -55,11 +54,9 @@ public class TestArtifactFilter
     public void testFiltering()
         throws Exception
     {
-        Set result = filtering();
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        Set<Artifact> result = filtering();
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getArtifactId().equals( "two" ) );
         }
     }
@@ -67,11 +64,9 @@ public class TestArtifactFilter
     public void testFiltering2()
         throws Exception
     {
-        Set result = filtering2();
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        Set<Artifact> result = filtering2();
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getArtifactId().equals( "two" ) || artifact.getArtifactId().equals( "four" ) );
         }
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestClassifierFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestClassifierFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestClassifierFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestClassifierFilter.java Sun Oct 21 14:18:01 2012
@@ -23,7 +23,6 @@ package org.apache.maven.shared.artifact
  * 
  */
 
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -57,11 +56,9 @@ public class TestClassifierFilter
     public void testFiltering()
         throws Exception
     {
-        Set result = filtering();
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        Set<Artifact> result = filtering();
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getClassifier().equals( "one" ) || artifact.getClassifier().equals( "two" ) );
         }
     }
@@ -69,11 +66,9 @@ public class TestClassifierFilter
     public void testFiltering2()
         throws Exception
     {
-        Set result = filtering2();
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        Set<Artifact> result = filtering2();
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getClassifier().equals( "two" ) || artifact.getClassifier().equals( "four" ) );
         }
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestFilterArtifacts.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestFilterArtifacts.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestFilterArtifacts.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestFilterArtifacts.java Sun Oct 21 14:18:01 2012
@@ -30,6 +30,7 @@ import java.util.Set;
 
 import junit.framework.TestCase;
 
+import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.testing.ArtifactStubFactory;
 import org.apache.maven.shared.utils.io.FileUtils;
 
@@ -57,7 +58,8 @@ public class TestFilterArtifacts
         FileUtils.deleteDirectory( outputFolder );
 
         ArtifactStubFactory fact = new ArtifactStubFactory( outputFolder, false );
-        Set artifacts = fact.getReleaseAndSnapshotArtifacts();
+        @SuppressWarnings( "unchecked" )
+        Set<Artifact> artifacts = fact.getReleaseAndSnapshotArtifacts();
         FilterArtifacts fa = new FilterArtifacts();
 
         fa.filter( artifacts );
@@ -68,7 +70,7 @@ public class TestFilterArtifacts
         fa.filter( artifacts );
         assertEquals( 0, fa.getFilters().size() );
 
-        ArrayList filters = new ArrayList();
+        ArrayList<ArtifactsFilter> filters = new ArrayList<ArtifactsFilter>();
         filters.add( null );
         filters.add( null );
         fa.setFilters( filters );
@@ -80,7 +82,7 @@ public class TestFilterArtifacts
 
     public void testArtifactFilter()
     {
-        Set a = new HashSet();
+        Set<Artifact> a = new HashSet<Artifact>();
         FilterArtifacts fa = new FilterArtifacts();
         ArtifactsFilter scope = new ScopeFilter( "compile", "system" );
         ArtifactsFilter type = new TypeFilter( "jar", "war" );
@@ -99,7 +101,7 @@ public class TestFilterArtifacts
         assertTrue( fa.getFilters().get( 1 ) instanceof ProjectTransitivityFilter );
         assertTrue( fa.getFilters().get( 2 ) instanceof TypeFilter );
 
-        ArrayList list = new ArrayList();
+        ArrayList<ArtifactsFilter> list = new ArrayList<ArtifactsFilter>();
         list.addAll( fa.getFilters() );
 
         fa.clearFilters();
@@ -118,10 +120,11 @@ public class TestFilterArtifacts
         File outputFolder = new File( "target/filters/" );
         FileUtils.deleteDirectory( outputFolder );
         ArtifactStubFactory fact = new ArtifactStubFactory( outputFolder, false );
-        Set artifacts = fact.getClassifiedArtifacts();
+        @SuppressWarnings( "unchecked" )
+        Set<Artifact> artifacts = fact.getClassifiedArtifacts();
         FilterArtifacts fa = new FilterArtifacts();
         fa.addFilter( new ClassifierFilter( "", "four" ) );
-        Set results = fa.filter( artifacts );
+        Set<Artifact> results = fa.filter( artifacts );
         assertEquals( 3, results.size() );
         fa.addFilter( new ClassifierFilter( "two,three", "" ) );
         results = fa.filter( artifacts );

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestGroupIdFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestGroupIdFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestGroupIdFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestGroupIdFilter.java Sun Oct 21 14:18:01 2012
@@ -24,7 +24,6 @@ package org.apache.maven.shared.artifact
  */
 
 import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -45,7 +44,6 @@ public class TestGroupIdFilter
         filterClass = GroupIdFilter.class;
         ArtifactStubFactory factory = new ArtifactStubFactory( null, false );
         artifacts = factory.getGroupIdArtifacts();
-
     }
 
     public void testParsing()
@@ -57,11 +55,9 @@ public class TestGroupIdFilter
     public void testFiltering()
         throws Exception
     {
-        Set result = filtering();
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        Set<Artifact> result = filtering();
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getGroupId().equals( "one" ) || artifact.getGroupId().equals( "two" ) );
         }
     }
@@ -69,11 +65,9 @@ public class TestGroupIdFilter
     public void testFiltering2()
         throws Exception
     {
-        Set result = filtering2();
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        Set<Artifact> result = filtering2();
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getGroupId().equals( "two" ) || artifact.getGroupId().equals( "four" ) );
         }
     }
@@ -88,14 +82,12 @@ public class TestGroupIdFilter
         throws Exception
     {
         // include o* from groupIds one,two should leave one
-        Set result = filtering();
+        Set<Artifact> result = filtering();
         assertEquals( 1, result.size() );
         GroupIdFilter filter = new GroupIdFilter( "o", null );
         result = filter.filter( result );
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getGroupId().equals( "one" ) );
 
         }
@@ -105,10 +97,8 @@ public class TestGroupIdFilter
         assertEquals( 1, result.size() );
         filter = new GroupIdFilter( null, "on" );
         result = filter.filter( result );
-        iter = result.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getGroupId().equals( "two" ) );
 
         }
@@ -122,7 +112,7 @@ public class TestGroupIdFilter
 
         assertEquals( 4, artifacts.size() );
 
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
 
         assertEquals( 2, result.size() );
     }
@@ -135,7 +125,7 @@ public class TestGroupIdFilter
 
         assertEquals( 4, artifacts.size() );
 
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
 
         assertEquals( 2, result.size() );
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestProjectTransitivityFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestProjectTransitivityFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestProjectTransitivityFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestProjectTransitivityFilter.java Sun Oct 21 14:18:01 2012
@@ -22,8 +22,6 @@ package org.apache.maven.shared.artifact
  * 
  */
 
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import junit.framework.TestCase;
@@ -37,11 +35,11 @@ import org.apache.maven.plugin.testing.A
 public class TestProjectTransitivityFilter
     extends TestCase
 {
-    Set artifacts = new HashSet();
+    Set<Artifact> artifacts;
 
-    Set directArtifacts = new HashSet();
+    Set<Artifact> directArtifacts;
     
-    Set classifiedArtifacts = new HashSet();
+    Set<Artifact> classifiedArtifacts;
 
     protected void setUp()
         throws Exception
@@ -60,7 +58,7 @@ public class TestProjectTransitivityFilt
     {
         ProjectTransitivityFilter filter = new ProjectTransitivityFilter( directArtifacts, false );
 
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
 
         assertEquals( 11, result.size() );
     }
@@ -71,14 +69,12 @@ public class TestProjectTransitivityFilt
         assertFalse( filter.isExcludeTransitive() );
         filter.setExcludeTransitive( true );
         assertTrue( filter.isExcludeTransitive() );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
 
         assertEquals( 2, result.size() );
 
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getArtifactId().equals( "release" ) || artifact.getArtifactId().equals( "snapshot" ) );
         }
     }
@@ -87,7 +83,7 @@ public class TestProjectTransitivityFilt
     {
         ProjectTransitivityFilter filter = new ProjectTransitivityFilter( classifiedArtifacts, true );
 
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
 
         assertEquals( 4, result.size() );
     }

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestScopeFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestScopeFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestScopeFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestScopeFilter.java Sun Oct 21 14:18:01 2012
@@ -22,8 +22,6 @@ package org.apache.maven.shared.artifact
  * 
  */
 
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import junit.framework.TestCase;
@@ -39,7 +37,7 @@ import org.apache.maven.plugin.testing.S
 public class TestScopeFilter
     extends TestCase
 {
-    Set artifacts = new HashSet();
+    Set<Artifact> artifacts;
 
     Log log = new SilentLog();
 
@@ -56,9 +54,7 @@ public class TestScopeFilter
         throws ArtifactFilterException
     {
         ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_COMPILE, null );
-        Set result;
-
-        result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 3, result.size() );
 
     }
@@ -67,8 +63,7 @@ public class TestScopeFilter
         throws ArtifactFilterException
     {
         ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_RUNTIME, null );
-        Set result;
-        result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 2, result.size() );
 
     }
@@ -77,7 +72,7 @@ public class TestScopeFilter
         throws ArtifactFilterException
     {
         ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_TEST, null );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 5, result.size() );
     }
 
@@ -86,12 +81,10 @@ public class TestScopeFilter
     {
 
         ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_PROVIDED, null );
-        Set result = filter.filter( artifacts );
-        Iterator iter = result.iterator();
+        Set<Artifact> result = filter.filter( artifacts );
         assertTrue( result.size() > 0 );
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertEquals( Artifact.SCOPE_PROVIDED, artifact.getScope() );
         }
     }
@@ -101,12 +94,10 @@ public class TestScopeFilter
     {
 
         ScopeFilter filter = new ScopeFilter( Artifact.SCOPE_SYSTEM, null );
-        Set result = filter.filter( artifacts );
-        Iterator iter = result.iterator();
+        Set<Artifact> result = filter.filter( artifacts );
         assertTrue( result.size() > 0 );
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertEquals( Artifact.SCOPE_SYSTEM, artifact.getScope() );
         }
     }
@@ -115,7 +106,7 @@ public class TestScopeFilter
         throws ArtifactFilterException
     {
         ScopeFilter filter = new ScopeFilter( null, null );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 5, result.size() );
     }
 
@@ -123,7 +114,7 @@ public class TestScopeFilter
         throws ArtifactFilterException
     {
         ScopeFilter filter = new ScopeFilter( "", "" );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 5, result.size() );
     }
 
@@ -131,15 +122,13 @@ public class TestScopeFilter
         throws ArtifactFilterException
     {
         ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_PROVIDED );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertNotNull( result );
         assertTrue( result.size() > 0 );
-        Iterator iter = result.iterator();
         assertNotNull( result );
         assertTrue( result.size() > 0 );
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertFalse( Artifact.SCOPE_PROVIDED.equalsIgnoreCase( artifact.getScope() ) );
         }
     }
@@ -148,13 +137,11 @@ public class TestScopeFilter
         throws ArtifactFilterException
     {
         ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_SYSTEM );
-        Set result = filter.filter( artifacts );
-        Iterator iter = result.iterator();
+        Set<Artifact> result = filter.filter( artifacts );
         assertNotNull( result );
         assertTrue( result.size() > 0 );
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertFalse( Artifact.SCOPE_SYSTEM.equalsIgnoreCase( artifact.getScope() ) );
         }
     }
@@ -163,7 +150,7 @@ public class TestScopeFilter
         throws ArtifactFilterException
     {
         ScopeFilter filter = new ScopeFilter( "", Artifact.SCOPE_COMPILE );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 2, result.size() );
     }
 

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestTypeFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestTypeFilter.java?rev=1400653&r1=1400652&r2=1400653&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestTypeFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/collection/TestTypeFilter.java Sun Oct 21 14:18:01 2012
@@ -22,8 +22,6 @@ package org.apache.maven.shared.artifact
  * 
  */
 
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -38,7 +36,7 @@ import org.apache.maven.plugin.testing.A
 public class TestTypeFilter
     extends TestCase
 {
-    Set artifacts = new HashSet();
+    Set<Artifact> artifacts;
 
     protected void setUp()
         throws Exception
@@ -52,8 +50,8 @@ public class TestTypeFilter
     public void testTypeParsing()
     {
         TypeFilter filter = new TypeFilter( "war,jar", "sources,zip," );
-        List includes = filter.getIncludes();
-        List excludes = filter.getExcludes();
+        List<String> includes = filter.getIncludes();
+        List<String> excludes = filter.getExcludes();
 
         assertEquals( 2, includes.size() );
         assertEquals( 2, excludes.size() );
@@ -66,13 +64,11 @@ public class TestTypeFilter
     public void testFiltering()
     {
         TypeFilter filter = new TypeFilter( "war,jar", "war,zip," );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 1, result.size() );
 
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( artifact.getType().equals( "jar" ) );
         }
     }
@@ -80,13 +76,11 @@ public class TestTypeFilter
     public void testFiltering2()
     {
         TypeFilter filter = new TypeFilter( null, "war,jar," );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 3, result.size() );
 
-        Iterator iter = result.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : result )
         {
-            Artifact artifact = (Artifact) iter.next();
             assertTrue( !artifact.getType().equals( "war" ) && !artifact.getType().equals( "jar" ) );
         }
     }
@@ -94,7 +88,7 @@ public class TestTypeFilter
     public void testFiltering3()
     {
         TypeFilter filter = new TypeFilter( null, null );
-        Set result = filter.filter( artifacts );
+        Set<Artifact> result = filter.filter( artifacts );
         assertEquals( 5, result.size() );
     }
 }



Mime
View raw message