maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1081021 [1/3] - in /maven/plugins/trunk/maven-dependency-plugin/src: main/java/org/apache/maven/plugin/dependency/ main/java/org/apache/maven/plugin/dependency/fromConfiguration/ main/java/org/apache/maven/plugin/dependency/resolvers/ main...
Date Sun, 13 Mar 2011 00:17:41 GMT
Author: hboutemy
Date: Sun Mar 13 00:17:39 2011
New Revision: 1081021

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

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportView.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/DOTDependencyNodeVisitor.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/TGFDependencyNodeVisitor.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/resolvers/ArtifactsResolver.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/resolvers/DefaultArtifactsResolver.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ArtifactTranslator.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestAnalyzeDepMgt.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestBuildClasspathMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo2.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestIncludeExcludeUnpackDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestIncludeExcludeUnpackMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestPropertiesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestTreeMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo2.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/DependencyPluginTest.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/ExecutionFailedException.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/DependencyArtifactStubFactory.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyStatusSets.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestDestFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestResolveMarkerFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/TestDefaultMarkerFileHandler.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/TestSourcesMarkerFileHandler.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/TestUnpackMarkerFileHandler.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java Sun Mar 13 00:17:39 2011
@@ -36,7 +36,6 @@ import org.apache.maven.shared.dependenc
 import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzerException;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
@@ -211,17 +210,17 @@ public abstract class AbstractAnalyzeMoj
             throw new MojoExecutionException( "Cannot analyze dependencies", exception );
         }
 
-        Set usedDeclared = analysis.getUsedDeclaredArtifacts();
-        Set usedUndeclared = analysis.getUsedUndeclaredArtifacts();
-        Set unusedDeclared = analysis.getUnusedDeclaredArtifacts();
+        Set<Artifact> usedDeclared = analysis.getUsedDeclaredArtifacts();
+        Set<Artifact> usedUndeclared = analysis.getUsedUndeclaredArtifacts();
+        Set<Artifact> unusedDeclared = analysis.getUnusedDeclaredArtifacts();
 
         if ( ignoreNonCompile )
         {
-            Set filteredUnusedDeclared = new HashSet( unusedDeclared );
-            Iterator iter = filteredUnusedDeclared.iterator();
+            Set<Artifact> filteredUnusedDeclared = new HashSet<Artifact>( unusedDeclared );
+            Iterator<Artifact> iter = filteredUnusedDeclared.iterator();
             while ( iter.hasNext() )
             {
-                Artifact artifact = (Artifact) iter.next();
+                Artifact artifact = iter.next();
                 if ( !artifact.getScope().equals( Artifact.SCOPE_COMPILE ) )
                 {
                     iter.remove();
@@ -270,7 +269,7 @@ public abstract class AbstractAnalyzeMoj
         return !usedUndeclared.isEmpty() || !unusedDeclared.isEmpty();
     }
 
-    private void logArtifacts( Set artifacts, boolean warn )
+    private void logArtifacts( Set<Artifact> artifacts, boolean warn )
     {
         if ( artifacts.isEmpty() )
         {
@@ -278,10 +277,8 @@ public abstract class AbstractAnalyzeMoj
         }
         else
         {
-            for ( Iterator iterator = artifacts.iterator(); iterator.hasNext(); )
+            for ( Artifact artifact : artifacts )
             {
-                Artifact artifact = (Artifact) iterator.next();
-
                 // called because artifact will set the version to -SNAPSHOT only if I do this. MNG-2961
                 artifact.isSnapshot();
 
@@ -298,7 +295,7 @@ public abstract class AbstractAnalyzeMoj
         }
     }
 
-    private void writeDependencyXML( Set artifacts )
+    private void writeDependencyXML( Set<Artifact> artifacts )
     {
         if ( !artifacts.isEmpty() )
         {
@@ -307,11 +304,8 @@ public abstract class AbstractAnalyzeMoj
             StringWriter out = new StringWriter();
             PrettyPrintXMLWriter writer = new PrettyPrintXMLWriter( out );
 
-            Iterator iter = artifacts.iterator();
-            while ( iter.hasNext() )
+            for ( Artifact artifact : artifacts )
             {
-                Artifact artifact = (Artifact) iter.next();
-
                 // called because artifact will set the version to -SNAPSHOT only if I do this. MNG-2961
                 artifact.isSnapshot();
 
@@ -345,18 +339,16 @@ public abstract class AbstractAnalyzeMoj
         }
     }
 
-    private void writeScriptableOutput( Set artifacts )
+    private void writeScriptableOutput( Set<Artifact> artifacts )
     {
         if ( !artifacts.isEmpty() )
         {
             getLog().info( "Missing dependencies: " );
             String pomFile = baseDir.getAbsolutePath() + File.separatorChar + "pom.xml";
             StringBuffer buf = new StringBuffer();
-            Iterator iter = artifacts.iterator();
-            while ( iter.hasNext() )
-            {
-                Artifact artifact = (Artifact) iter.next();
 
+            for ( Artifact artifact : artifacts )
+            {
                 // called because artifact will set the version to -SNAPSHOT only if I do this. MNG-2961
                 artifact.isSnapshot();
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java Sun Mar 13 00:17:39 2011
@@ -19,6 +19,7 @@ import java.io.File;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.dependency.utils.DependencyStatusSets;
 import org.apache.maven.plugin.dependency.utils.DependencyUtil;
@@ -225,7 +226,7 @@ public abstract class AbstractDependency
      * @return A HashSet of artifacts
      * @throws MojoExecutionException
      */
-    protected Set getResolvedDependencies( boolean stopOnFailure )
+    protected Set<Artifact> getResolvedDependencies( boolean stopOnFailure )
         throws MojoExecutionException
 
     {
@@ -269,7 +270,7 @@ public abstract class AbstractDependency
                                                 DependencyUtil.cleanToBeTokenizedString( this.excludeArtifactIds ) ) );
 
         // start with all artifacts.
-        Set artifacts = project.getArtifacts();
+        Set<Artifact> artifacts = project.getArtifacts();
 
         // perform filtering
         try
@@ -305,11 +306,11 @@ public abstract class AbstractDependency
      *         on the projects dependencies
      * @throws MojoExecutionException
      */
-    protected DependencyStatusSets getClassifierTranslatedDependencies( Set artifacts, boolean stopOnFailure )
+    protected DependencyStatusSets getClassifierTranslatedDependencies( Set<Artifact> artifacts, boolean stopOnFailure )
         throws MojoExecutionException
     {
-        Set unResolvedArtifacts = new HashSet();
-        Set resolvedArtifacts = artifacts;
+        Set<Artifact> unResolvedArtifacts = new HashSet<Artifact>();
+        Set<Artifact> resolvedArtifacts = artifacts;
         DependencyStatusSets status = new DependencyStatusSets();
 
         // possibly translate artifacts into a new set of artifacts based on the
@@ -349,7 +350,7 @@ public abstract class AbstractDependency
      * @return
      * @throws MojoExecutionException
      */
-    protected DependencyStatusSets filterMarkedDependencies( Set artifacts )
+    protected DependencyStatusSets filterMarkedDependencies( Set<Artifact> artifacts )
         throws MojoExecutionException
     {
         // remove files that have markers already
@@ -357,7 +358,7 @@ public abstract class AbstractDependency
         filter.clearFilters();
         filter.addFilter( getMarkedArtifactFilter() );
 
-        Set unMarkedArtifacts;
+        Set<Artifact> unMarkedArtifacts;
         try
         {
             unMarkedArtifacts = filter.filter( artifacts );
@@ -368,7 +369,7 @@ public abstract class AbstractDependency
         }
 
         // calculate the skipped artifacts
-        Set skippedArtifacts = new HashSet();
+        Set<Artifact> skippedArtifacts = new HashSet<Artifact>();
         skippedArtifacts.addAll( artifacts );
         skippedArtifacts.removeAll( unMarkedArtifacts );
 
@@ -397,7 +398,8 @@ public abstract class AbstractDependency
     /**
      * @return true, if the groupId should be prepended to the filename. 
      */
-    public boolean isPrependGroupId() {
+    public boolean isPrependGroupId()
+    {
         return prependGroupId;
     }
 
@@ -405,7 +407,8 @@ public abstract class AbstractDependency
      * @param prependGroupId - 
      *            true if the groupId must be prepended during the copy.
      */
-    public void setPrependGroupId(boolean prependGroupId) {
+    public void setPrependGroupId( boolean prependGroupId )
+    {
         this.prependGroupId = prependGroupId;
     }
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java Sun Mar 13 00:17:39 2011
@@ -23,8 +23,11 @@ import java.io.File;
 import java.lang.reflect.Field;
 import java.util.List;
 
+import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.resolver.ArtifactCollector;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.dependency.utils.DependencySilentLog;
@@ -52,14 +55,14 @@ public abstract class AbstractDependency
      *
      * @component
      */
-    protected org.apache.maven.artifact.factory.ArtifactFactory factory;
+    protected ArtifactFactory factory;
 
     /**
      * Used to look up Artifacts in the remote repository.
      *
      * @component
      */
-    protected org.apache.maven.artifact.resolver.ArtifactResolver resolver;
+    protected ArtifactResolver resolver;
 
     /**
      * Artifact collector, needed to resolve dependencies.
@@ -85,7 +88,7 @@ public abstract class AbstractDependency
      * @readonly
      * @required
      */
-    private org.apache.maven.artifact.repository.ArtifactRepository local;
+    private ArtifactRepository local;
 
     /**
      * List of Remote Repositories used by the resolver
@@ -94,7 +97,7 @@ public abstract class AbstractDependency
      * @readonly
      * @required
      */
-    protected java.util.List remoteRepos;
+    protected List remoteRepos;
 
     /**
      * To look up Archiver/UnArchiver implementations
@@ -332,7 +335,7 @@ public abstract class AbstractDependency
     /**
      * @return Returns the remoteRepos.
      */
-    public java.util.List getRemoteRepos ()
+    public List getRemoteRepos ()
     {
         return this.remoteRepos;
     }
@@ -340,7 +343,7 @@ public abstract class AbstractDependency
     /**
      * @param remoteRepos The remoteRepos to set.
      */
-    public void setRemoteRepos ( java.util.List remoteRepos )
+    public void setRemoteRepos ( List remoteRepos )
     {
         this.remoteRepos = remoteRepos;
     }
@@ -356,7 +359,7 @@ public abstract class AbstractDependency
     /**
      * @param resolver The resolver to set.
      */
-    public void setResolver ( org.apache.maven.artifact.resolver.ArtifactResolver resolver )
+    public void setResolver ( ArtifactResolver resolver )
     {
         this.resolver = resolver;
     }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java Sun Mar 13 00:17:39 2011
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.dependen
  */
 
 import java.io.File;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -78,15 +77,15 @@ public abstract class AbstractResolveMoj
 	 */
 	protected boolean appendOutput;
     
-    protected Set resolveDependencyArtifacts( MavenProject theProject )
+    protected Set<Artifact> resolveDependencyArtifacts( MavenProject theProject )
         throws ArtifactResolutionException, ArtifactNotFoundException, InvalidDependencyVersionException
     {
-        Set artifacts = theProject.createArtifacts( this.factory, Artifact.SCOPE_TEST,
-                                                    new ScopeArtifactFilter( Artifact.SCOPE_TEST ) );
+        Set<Artifact> artifacts =
+            theProject.createArtifacts( this.factory, Artifact.SCOPE_TEST,
+                                        new ScopeArtifactFilter( Artifact.SCOPE_TEST ) );
 
-        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+        for ( Artifact artifact : artifacts )
         {
-            Artifact artifact = (Artifact) i.next();
             // resolve the new artifact
             this.resolver.resolve( artifact, this.remoteRepos, this.getLocal() );
         }
@@ -106,7 +105,7 @@ public abstract class AbstractResolveMoj
      * @throws ProjectBuildingException
      * @throws InvalidDependencyVersionException
      */
-    protected Set resolveArtifactDependencies( Artifact artifact )
+    protected Set<Artifact> resolveArtifactDependencies( Artifact artifact )
         throws ArtifactResolutionException, ArtifactNotFoundException, ProjectBuildingException,
         InvalidDependencyVersionException
     {

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java Sun Mar 13 00:17:39 2011
@@ -22,7 +22,6 @@ package org.apache.maven.plugin.dependen
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -116,7 +115,7 @@ public class AnalyzeDepMgt
 
         getLog().info( "Found Resolved Dependency / DependencyManagement mismatches:" );
 
-        List depMgtDependencies = null;
+        List<Dependency> depMgtDependencies = null;
 
         DependencyManagement depMgt = project.getDependencyManagement();
         if ( depMgt != null )
@@ -127,12 +126,10 @@ public class AnalyzeDepMgt
         if ( depMgtDependencies != null && !depMgtDependencies.isEmpty() )
         {
             // put all the dependencies from depMgt into a map for quick lookup
-            Map depMgtMap = new HashMap();
-            Map exclusions = new HashMap();
-            Iterator iter = depMgtDependencies.iterator();
-            while ( iter.hasNext() )
+            Map<String, Dependency> depMgtMap = new HashMap<String, Dependency>();
+            Map<String, Exclusion> exclusions = new HashMap<String, Exclusion>();
+            for ( Dependency depMgtDependency : depMgtDependencies )
             {
-                Dependency depMgtDependency = (Dependency) iter.next();
                 depMgtMap.put( depMgtDependency.getManagementKey(), depMgtDependency );
 
                 // now put all the exclusions into a map for quick lookup
@@ -140,23 +137,21 @@ public class AnalyzeDepMgt
             }
 
             // get dependencies for the project (including transitive)
-            Set allDependencyArtifacts = new HashSet( project.getArtifacts() );
+            Set<Artifact> allDependencyArtifacts = new HashSet<Artifact>( project.getArtifacts() );
 
             // don't warn if a dependency that is directly listed overrides
             // depMgt. That's ok.
             if ( this.ignoreDirect )
             {
                 getLog().info( "\tIgnoring Direct Dependencies." );
-                Set directDependencies = project.getDependencyArtifacts();
+                Set<Artifact> directDependencies = project.getDependencyArtifacts();
                 allDependencyArtifacts.removeAll( directDependencies );
             }
 
             // log exclusion errors
-            List exclusionErrors = getExclusionErrors( exclusions, allDependencyArtifacts );
-            Iterator exclusionIter = exclusionErrors.iterator();
-            while ( exclusionIter.hasNext() )
+            List<Artifact> exclusionErrors = getExclusionErrors( exclusions, allDependencyArtifacts );
+            for ( Artifact exclusion : exclusionErrors )
             {
-                Artifact exclusion = (Artifact) exclusionIter.next();
                 getLog().info(
                                StringUtils.stripEnd( getArtifactManagementKey( exclusion ), ":" )
                                    + " was excluded in DepMgt, but version " + exclusion.getVersion()
@@ -165,13 +160,10 @@ public class AnalyzeDepMgt
             }
 
             // find and log version mismatches
-            Map mismatch = getMismatch( depMgtMap, allDependencyArtifacts );
-            Iterator mismatchIter = mismatch.keySet().iterator();
-            while ( mismatchIter.hasNext() )
+            Map<Artifact, Dependency> mismatch = getMismatch( depMgtMap, allDependencyArtifacts );
+            for ( Map.Entry<Artifact, Dependency> entry : mismatch.entrySet() )
             {
-                Artifact resolvedArtifact = (Artifact) mismatchIter.next();
-                Dependency depMgtDependency = (Dependency) mismatch.get( resolvedArtifact );
-                logMismatch( resolvedArtifact, depMgtDependency );
+                logMismatch( entry.getKey(), entry.getValue() );
                 foundError = true;
             }
             if ( !foundError )
@@ -198,15 +190,13 @@ public class AnalyzeDepMgt
      * @return a map of the exclusions using the Dependency ManagementKey as the
      *         keyset.
      */
-    public Map addExclusions( List exclusionList )
+    public Map<String, Exclusion> addExclusions( List<Exclusion> exclusionList )
     {
-        Map exclusions = new HashMap();
+        Map<String, Exclusion> exclusions = new HashMap<String, Exclusion>();
         if ( exclusionList != null )
         {
-            Iterator exclusionIter = exclusionList.iterator();
-            while ( exclusionIter.hasNext() )
+            for ( Exclusion exclusion : exclusionList )
             {
-                Exclusion exclusion = (Exclusion) exclusionIter.next();
                 exclusions.put( getExclusionKey( exclusion ), exclusion );
             }
         }
@@ -224,14 +214,12 @@ public class AnalyzeDepMgt
      *            resolved artifacts to be compared.
      * @return list of artifacts that should have been excluded.
      */
-    public List getExclusionErrors( Map exclusions, Set allDependencyArtifacts )
+    public List<Artifact> getExclusionErrors( Map<String, Exclusion> exclusions, Set<Artifact> allDependencyArtifacts )
     {
-        List list = new ArrayList();
+        List<Artifact> list = new ArrayList<Artifact>();
 
-        Iterator iter = allDependencyArtifacts.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : allDependencyArtifacts )
         {
-            Artifact artifact = (Artifact) iter.next();
             if ( exclusions.containsKey( getExclusionKey( artifact ) ) )
             {
                 list.add( artifact );
@@ -263,18 +251,16 @@ public class AnalyzeDepMgt
      * @return a map containing the resolved artifact as the key and the listed
      *         dependency as the value.
      */
-    public Map getMismatch( Map depMgtMap, Set allDependencyArtifacts )
+    public Map<Artifact, Dependency> getMismatch( Map<String, Dependency> depMgtMap,
+                                                  Set<Artifact> allDependencyArtifacts )
     {
-        Map mismatchMap = new HashMap();
+        Map<Artifact, Dependency> mismatchMap = new HashMap<Artifact, Dependency>();
 
-        Iterator iter = allDependencyArtifacts.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact dependencyArtifact : allDependencyArtifacts )
         {
-            Artifact dependencyArtifact = (Artifact) iter.next();
-            Dependency depFromDepMgt = (Dependency) depMgtMap.get( getArtifactManagementKey( dependencyArtifact ) );
+            Dependency depFromDepMgt = depMgtMap.get( getArtifactManagementKey( dependencyArtifact ) );
             if ( depFromDepMgt != null )
             {
-
                 //workaround for MNG-2961
                 dependencyArtifact.isSnapshot();
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java Sun Mar 13 00:17:39 2011
@@ -71,13 +71,13 @@ public class AnalyzeDuplicateMojo
             throw new MojoExecutionException( "IOException: " + e.getMessage(), e );
         }
 
-        Set duplicateDependencies = new HashSet();
+        Set<String> duplicateDependencies = new HashSet<String>();
         if ( model.getDependencies() != null )
         {
             duplicateDependencies = findDuplicateDependencies( model.getDependencies() );
         }
 
-        Set duplicateDependenciesManagement = new HashSet();
+        Set<String> duplicateDependenciesManagement = new HashSet<String>();
         if ( model.getDependencyManagement() != null && model.getDependencyManagement().getDependencies() != null )
         {
             duplicateDependenciesManagement =
@@ -91,9 +91,9 @@ public class AnalyzeDuplicateMojo
             if ( !duplicateDependencies.isEmpty() )
             {
                 sb.append( "List of duplicate dependencies defined in <dependencies/> in your pom.xml:\n" );
-                for ( Iterator it = duplicateDependencies.iterator(); it.hasNext(); )
+                for ( Iterator<String> it = duplicateDependencies.iterator(); it.hasNext(); )
                 {
-                    String dup = (String) it.next();
+                    String dup = it.next();
 
                     sb.append( "\to " + dup );
                     if ( it.hasNext() )
@@ -111,9 +111,9 @@ public class AnalyzeDuplicateMojo
                 }
                 sb.append( "List of duplicate dependencies defined in <dependencyManagement/> in "
                     + "your pom.xml:\n" );
-                for ( Iterator it = duplicateDependenciesManagement.iterator(); it.hasNext(); )
+                for ( Iterator<String> it = duplicateDependenciesManagement.iterator(); it.hasNext(); )
                 {
-                    String dup = (String) it.next();
+                    String dup = it.next();
 
                     sb.append( "\to " + dup );
                     if ( it.hasNext() )
@@ -134,16 +134,15 @@ public class AnalyzeDuplicateMojo
         }
     }
 
-    private Set findDuplicateDependencies( List modelDependencies )
+    private Set<String> findDuplicateDependencies( List<Dependency> modelDependencies )
     {
-        List modelDependencies2 = new ArrayList();
-        for ( Iterator it = modelDependencies.iterator(); it.hasNext(); )
+        List<String> modelDependencies2 = new ArrayList<String>();
+        for ( Dependency dep : modelDependencies )
         {
-            Dependency dep = (Dependency) it.next();
-
             modelDependencies2.add( dep.getManagementKey() );
         }
 
-        return new HashSet( CollectionUtils.disjunction( modelDependencies2, new HashSet( modelDependencies2 ) ) );
+        return new HashSet<String>( CollectionUtils.disjunction( modelDependencies2,
+                                                                 new HashSet<String>( modelDependencies2 ) ) );
     }
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java Sun Mar 13 00:17:39 2011
@@ -127,11 +127,11 @@ public class AnalyzeReportMojo
         //remove everything that's not in the compile scope
         if ( ignoreNonCompile )
         {
-            Set filteredUnusedDeclared = new HashSet( analysis.getUnusedDeclaredArtifacts() );
-            Iterator iter = filteredUnusedDeclared.iterator();
+            Set<Artifact> filteredUnusedDeclared = new HashSet<Artifact>( analysis.getUnusedDeclaredArtifacts() );
+            Iterator<Artifact> iter = filteredUnusedDeclared.iterator();
             while ( iter.hasNext() )
             {
-                Artifact artifact = (Artifact) iter.next();
+                Artifact artifact = iter.next();
                 if ( !artifact.getScope().equals( Artifact.SCOPE_COMPILE ) )
                 {
                     iter.remove();

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportView.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportView.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportView.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportView.java Sun Mar 13 00:17:39 2011
@@ -64,7 +64,7 @@ public class AnalyzeReportView
         }
         else
         {
-            Iterator iter = analysis.getUsedDeclaredArtifacts().iterator();
+            Iterator<Artifact> iter = analysis.getUsedDeclaredArtifacts().iterator();
             generateDependenciesTable( sink, iter );
         }
         sink.section2_();
@@ -83,7 +83,7 @@ public class AnalyzeReportView
         }
         else
         {
-            Iterator iter = analysis.getUsedUndeclaredArtifacts().iterator();
+            Iterator<Artifact> iter = analysis.getUsedUndeclaredArtifacts().iterator();
             generateDependenciesTable( sink, iter );
         }
         sink.section2_();
@@ -102,7 +102,7 @@ public class AnalyzeReportView
         }
         else
         {
-            Iterator iter = analysis.getUnusedDeclaredArtifacts().iterator();
+            Iterator<Artifact> iter = analysis.getUnusedDeclaredArtifacts().iterator();
             generateDependenciesTable( sink, iter );
         }
         sink.section2_();
@@ -118,7 +118,7 @@ public class AnalyzeReportView
     /**
      * Generate a table for the given dependencies iterator.
      */
-    public void generateDependenciesTable( Sink sink, Iterator iter )
+    public void generateDependenciesTable( Sink sink, Iterator<Artifact> iter )
     {
         sink.table();
 
@@ -168,7 +168,7 @@ public class AnalyzeReportView
         sink.tableRow_();
         while ( iter.hasNext() )
         {
-            Artifact artifact = (Artifact) iter.next();
+            Artifact artifact = iter.next();
 
             sink.tableRow();
             sink.tableCell();

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java Sun Mar 13 00:17:39 2011
@@ -53,7 +53,7 @@ import org.codehaus.plexus.util.StringUt
  */
 public class BuildClasspathMojo
     extends AbstractDependencyFilterMojo
-    implements Comparator
+    implements Comparator<Artifact>
 {
 
     /**
@@ -194,21 +194,21 @@ public class BuildClasspathMojo
             localRepoProperty = "${M2_REPO}";
         }
 
-        Set artifacts = getResolvedDependencies( true );
+        Set<Artifact> artifacts = getResolvedDependencies( true );
 
         if ( artifacts == null || artifacts.isEmpty() )
         {
             getLog().info( "No dependencies found." );
         }
 
-        List artList = new ArrayList( artifacts );
+        List<Artifact> artList = new ArrayList<Artifact>( artifacts );
 
         StringBuffer sb = new StringBuffer();
-        Iterator i = artList.iterator();
+        Iterator<Artifact> i = artList.iterator();
 
         if ( i.hasNext() )
         {
-            appendArtifactPath( (Artifact) i.next(), sb );
+            appendArtifactPath( i.next(), sb );
 
             while ( i.hasNext() )
             {
@@ -398,41 +398,31 @@ public class BuildClasspathMojo
     /**
      * Compares artifacts lexicographically, using pattern [group_id][artifact_id][version].
      *
-     * @param arg1 first object
-     * @param arg2 second object
+     * @param art1 first object
+     * @param art2 second object
      * @return the value <code>0</code> if the argument string is equal to this string; a value less than
      *         <code>0</code> if this string is lexicographically less than the string argument; and a value greater
      *         than <code>0</code> if this string is lexicographically greater than the string argument.
      */
-    public int compare( Object arg1, Object arg2 )
+    public int compare( Artifact art1, Artifact art2 )
     {
-        if ( arg1 instanceof Artifact && arg2 instanceof Artifact )
+        if ( art1 == art2 )
         {
-            if ( arg1 == arg2 )
-            {
-                return 0;
-            }
-            else if ( arg1 == null )
-            {
-                return -1;
-            }
-            else if ( arg2 == null )
-            {
-                return +1;
-            }
-
-            Artifact art1 = (Artifact) arg1;
-            Artifact art2 = (Artifact) arg2;
-
-            String s1 = art1.getGroupId() + art1.getArtifactId() + art1.getVersion();
-            String s2 = art2.getGroupId() + art2.getArtifactId() + art2.getVersion();
-
-            return s1.compareTo( s2 );
+            return 0;
         }
-        else
+        else if ( art1 == null )
         {
-            return 0;
+            return -1;
         }
+        else if ( art2 == null )
+        {
+            return +1;
+        }
+
+        String s1 = art1.getGroupId() + art1.getArtifactId() + art1.getVersion();
+        String s2 = art2.getGroupId() + art2.getArtifactId() + art2.getVersion();
+
+        return s1.compareTo( s2 );
     }
 
     protected ArtifactsFilter getMarkedArtifactFilter()

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java Sun Mar 13 00:17:39 2011
@@ -21,7 +21,6 @@ package org.apache.maven.plugin.dependen
 
 import java.io.File;
 import java.net.MalformedURLException;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -65,7 +64,7 @@ public class CopyDependenciesMojo
     /**
      * @component role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
      */
-    private Map repositoryLayouts;
+    private Map<String, ArtifactRepositoryLayout> repositoryLayouts;
 
     /**
      * Main entry into mojo. Gets the list of dependencies and iterates through
@@ -81,13 +80,13 @@ public class CopyDependenciesMojo
         throws MojoExecutionException
     {
         DependencyStatusSets dss = getDependencySets( this.failOnMissingClassifierArtifact );
-        Set artifacts = dss.getResolvedDependencies();
+        Set<Artifact> artifacts = dss.getResolvedDependencies();
 
         if ( !useRepositoryLayout )
         {
-            for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+            for ( Artifact artifact : artifacts )
             {
-	    		copyArtifact( (Artifact) i.next(), this.stripVersion, this.prependGroupId );
+	    		copyArtifact( artifact, this.stripVersion, this.prependGroupId );
             }
         }
         else
@@ -99,9 +98,9 @@ public class CopyDependenciesMojo
                         outputDirectory.toURL().toExternalForm(),
                         (ArtifactRepositoryLayout) repositoryLayouts.get( "default" ),
                         false /*uniqueVersion*/ );
-                for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+                for ( Artifact artifact : artifacts )
                 {
-                    installArtifact( (Artifact) i.next(), targetRepository );
+                    installArtifact( artifact, targetRepository );
                 }
             }
             catch ( MalformedURLException e )
@@ -110,10 +109,9 @@ public class CopyDependenciesMojo
             }
         }
 
-        Set skippedArtifacts = dss.getSkippedDependencies();
-        for ( Iterator i = skippedArtifacts.iterator(); i.hasNext(); )
+        Set<Artifact> skippedArtifacts = dss.getSkippedDependencies();
+        for ( Artifact artifact : skippedArtifacts )
         {
-            Artifact artifact = (Artifact) i.next();
             getLog().info( artifact.getFile().getName() + " already exists in destination." );
         }
 
@@ -202,13 +200,12 @@ public class CopyDependenciesMojo
     /**
      * Copy the pom files associated with the artifacts.
      */
-    public void copyPoms( File destDir, Set artifacts, boolean removeVersion ) throws MojoExecutionException
+    public void copyPoms( File destDir, Set<Artifact> artifacts, boolean removeVersion )
+        throws MojoExecutionException
 
     {
-        Iterator iter = artifacts.iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : artifacts )
         {
-            Artifact artifact = (Artifact)iter.next();
             Artifact pomArtifact = getResolvedPomArtifact( artifact );
 
             // Copy the pom

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java Sun Mar 13 00:17:39 2011
@@ -19,7 +19,6 @@ package org.apache.maven.plugin.dependen
  * under the License.
  */
 
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -59,11 +58,10 @@ public class PropertiesMojo
     public void execute()
         throws MojoExecutionException
     {
-        Set artifacts = getProject().getArtifacts();
+        Set<Artifact> artifacts = getProject().getArtifacts();
         
-        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+        for ( Artifact artifact : artifacts )
         {
-            Artifact artifact = (Artifact) i.next();
             project.getProperties().setProperty( artifact.getDependencyConflictId(),
                                                  artifact.getFile().getAbsolutePath() );
         }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java Sun Mar 13 00:17:39 2011
@@ -79,7 +79,7 @@ public class PurgeLocalRepositoryMojo
      * @required
      * @readonly
      */
-    private List projects;
+    private List<MavenProject> projects;
 
     /**
      * The list of dependencies in the form of groupId:artifactId which should
@@ -87,7 +87,7 @@ public class PurgeLocalRepositoryMojo
      * 
      * @parameter
      */
-    private List excludes;
+    private List<String> excludes;
 
     /**
      * Comma-separated list of groupId:artifactId entries, which should be used
@@ -174,12 +174,10 @@ public class PurgeLocalRepositoryMojo
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
-        List exclusionPatterns = buildExclusionPatternsList();
+        List<String> exclusionPatterns = buildExclusionPatternsList();
 
-        for ( Iterator it = projects.iterator(); it.hasNext(); )
+        for ( MavenProject project : projects )
         {
-            MavenProject project = (MavenProject) it.next();
-
             try
             {
                 refreshDependenciesForProject( project, exclusionPatterns );
@@ -198,9 +196,9 @@ public class PurgeLocalRepositoryMojo
         }
     }
 
-    private List buildExclusionPatternsList()
+    private List<String> buildExclusionPatternsList()
     {
-        List patterns = new ArrayList();
+        List<String> patterns = new ArrayList<String>();
 
         if ( exclude != null )
         {
@@ -216,20 +214,18 @@ public class PurgeLocalRepositoryMojo
         return patterns;
     }
 
-    private Map createArtifactMap( MavenProject project )
+    private Map<String, Artifact> createArtifactMap( MavenProject project )
     {
-        Map artifactMap = Collections.EMPTY_MAP;
+        Map<String, Artifact> artifactMap = Collections.emptyMap();
 
-        List dependencies = project.getDependencies();
+        List<Dependency> dependencies = project.getDependencies();
 
         List remoteRepositories = Collections.EMPTY_LIST;
 
-        Set dependencyArtifacts = new HashSet();
+        Set<Artifact> dependencyArtifacts = new HashSet<Artifact>();
 
-        for ( Iterator it = dependencies.iterator(); it.hasNext(); )
+        for ( Dependency dependency : dependencies )
         {
-            Dependency dependency = (Dependency) it.next();
-
             VersionRange vr = VersionRange.createFromVersion( dependency.getVersion() );
 
             Artifact artifact = factory.createDependencyArtifact( dependency.getGroupId(), dependency.getArtifactId(),
@@ -258,11 +254,9 @@ public class PurgeLocalRepositoryMojo
         }
         else
         {
-            artifactMap = new HashMap();
-            for ( Iterator it = dependencyArtifacts.iterator(); it.hasNext(); )
+            artifactMap = new HashMap<String, Artifact>();
+            for ( Artifact artifact : dependencyArtifacts )
             {
-                Artifact artifact = (Artifact) it.next();
-
                 try
                 {
                     resolver.resolve( artifact, remoteRepositories, localRepository );
@@ -291,10 +285,10 @@ public class PurgeLocalRepositoryMojo
         }
     }
 
-    private void refreshDependenciesForProject( MavenProject project, List exclusionPatterns )
+    private void refreshDependenciesForProject( MavenProject project, List<String> exclusionPatterns )
         throws ArtifactResolutionException, MojoFailureException
     {
-        Map deps = createArtifactMap( project );
+        Map<String, Artifact> deps = createArtifactMap( project );
 
         if ( deps.isEmpty() )
         {
@@ -304,21 +298,20 @@ public class PurgeLocalRepositoryMojo
 
         if ( !exclusionPatterns.isEmpty() )
         {
-            for ( Iterator it = exclusionPatterns.iterator(); it.hasNext(); )
+            for ( String excludedKey : exclusionPatterns )
             {
-            	String excludedKey = (String) it.next();
-            	
-            	if (GROUP_ID_FUZZINESS.equals(resolutionFuzziness))
-            	{
-            		verbose( "Excluding groupId: " + excludedKey + " from refresh operation for project: " + project.getId() );
-            		
-            		for ( Iterator deps_it = deps.entrySet().iterator(); deps_it.hasNext(); )
-            		{
-            			Map.Entry dependency = (Map.Entry) deps_it.next();
+                if ( GROUP_ID_FUZZINESS.equals( resolutionFuzziness ) )
+                {
+                    verbose( "Excluding groupId: " + excludedKey + " from refresh operation for project: "
+                        + project.getId() );
+
+                    for ( Iterator<Map.Entry<String, Artifact>> deps_it = deps.entrySet().iterator(); deps_it.hasNext(); )
+                    {
+                        Map.Entry<String, Artifact> dependency = deps_it.next();
             			
-            			Artifact artifact = (Artifact) dependency.getValue();
+            			Artifact artifact = dependency.getValue();
             			
-            			if (artifact.getGroupId().equals(excludedKey))
+                        if ( artifact.getGroupId().equals( excludedKey ) )
             			{
             				deps_it.remove();
             			}
@@ -335,12 +328,10 @@ public class PurgeLocalRepositoryMojo
 
         verbose( "Processing dependencies for project: " + project.getId() );
 
-        List missingArtifacts = new ArrayList();
-        for ( Iterator it = deps.entrySet().iterator(); it.hasNext(); )
+        List<Artifact> missingArtifacts = new ArrayList<Artifact>();
+        for ( Map.Entry<String, Artifact> entry : deps.entrySet() )
         {
-            Map.Entry entry = (Map.Entry) it.next();
-
-            Artifact artifact = (Artifact) entry.getValue();
+            Artifact artifact = entry.getValue();
 
             verbose( "Processing artifact: " + artifact.getId() );
 
@@ -391,9 +382,8 @@ public class PurgeLocalRepositoryMojo
         if ( missingArtifacts.size() > 0 )
         {
             String message = "required artifacts missing:\n";
-            for ( Iterator i = missingArtifacts.iterator(); i.hasNext(); )
+            for ( Artifact missingArtifact : missingArtifacts )
             {
-                Artifact missingArtifact = (Artifact) i.next();
                 message += "  " + missingArtifact.getId() + "\n";
             }
             message += "\nfor the artifact:";

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java Sun Mar 13 00:17:39 2011
@@ -436,7 +436,7 @@ public class TreeMojo extends AbstractMo
      */
     private DependencyNodeFilter createDependencyNodeFilter()
     {
-        List filters = new ArrayList();
+        List<DependencyNodeFilter> filters = new ArrayList<DependencyNodeFilter>();
 
         // filter node states
         if ( !verbose )
@@ -449,7 +449,7 @@ public class TreeMojo extends AbstractMo
         // filter includes
         if ( includes != null )
         {
-            List patterns = Arrays.asList( includes.split( "," ) );
+            List<String> patterns = Arrays.asList( includes.split( "," ) );
 
             getLog().debug( "+ Filtering dependency tree by artifact include patterns: " + patterns );
 
@@ -460,7 +460,7 @@ public class TreeMojo extends AbstractMo
         // filter excludes
         if ( excludes != null )
         {
-            List patterns = Arrays.asList( excludes.split( "," ) );
+            List<String> patterns = Arrays.asList( excludes.split( "," ) );
 
             getLog().debug( "+ Filtering dependency tree by artifact exclude patterns: " + patterns );
 
@@ -492,9 +492,9 @@ public class TreeMojo extends AbstractMo
         if ( recommendedVersion == null )
         {
 
-            for ( Iterator i = allowedRange.getRestrictions().iterator(); i.hasNext() && !matched; )
+            for ( Iterator<Restriction> i = allowedRange.getRestrictions().iterator(); i.hasNext() && !matched; )
             {
-                Restriction restriction = (Restriction) i.next();
+                Restriction restriction = i.next();
                 if ( restriction.containsVersion( theVersion ) )
                 {
                     matched = true;

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java Sun Mar 13 00:17:39 2011
@@ -20,8 +20,6 @@ package org.apache.maven.plugin.dependen
  */
 
 import java.io.File;
-import java.util.Iterator;
-import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -76,11 +74,9 @@ public class UnpackDependenciesMojo
         throws MojoExecutionException
     {
         DependencyStatusSets dss = getDependencySets( this.failOnMissingClassifierArtifact );
-        Set artifacts = dss.getResolvedDependencies();
 
-        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+        for ( Artifact artifact : dss.getResolvedDependencies() )
         {
-            Artifact artifact = (Artifact) i.next();
             File destDir;
             destDir = DependencyUtil.getFormattedOutputDirectory( useSubDirectoryPerScope, useSubDirectoryPerType, useSubDirectoryPerArtifact,
                                                                   useRepositoryLayout, stripVersion, outputDirectory,
@@ -90,10 +86,8 @@ public class UnpackDependenciesMojo
             handler.setMarker();
         }
 
-        artifacts = dss.getSkippedDependencies();
-        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+        for ( Artifact artifact : dss.getSkippedDependencies() )
         {
-            Artifact artifact = (Artifact) i.next();
             getLog().info( artifact.getFile().getName() + " already exists in destination." );
         }
     }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java Sun Mar 13 00:17:39 2011
@@ -20,8 +20,6 @@ package org.apache.maven.plugin.dependen
  */
 
 import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.maven.artifact.Artifact;
@@ -103,7 +101,7 @@ public abstract class AbstractFromConfig
      * @required
      * @since 1.0
      */
-    private ArrayList artifactItems;
+    private List<ArtifactItem> artifactItems;
 
     /**
      * To look up ArtifactRepository implementation
@@ -138,7 +136,7 @@ public abstract class AbstractFromConfig
      * @throws MojoExecutionException with a message if an error occurs.
      * @see ArtifactItem
      */
-    protected ArrayList getProcessedArtifactItems( boolean removeVersion )
+    protected List<ArtifactItem> getProcessedArtifactItems( boolean removeVersion )
         throws MojoExecutionException
     {
         if ( artifactItems == null || artifactItems.size() < 1 )
@@ -146,10 +144,8 @@ public abstract class AbstractFromConfig
             throw new MojoExecutionException( "There are no artifactItems configured." );
         }
 
-        Iterator iter = artifactItems.iterator();
-        while ( iter.hasNext() )
+        for ( ArtifactItem artifactItem : artifactItems )
         {
-            ArtifactItem artifactItem = (ArtifactItem) iter.next();
             this.getLog().info( "Configured Artifact: " + artifactItem.toString() );
 
             if ( artifactItem.getOutputDirectory() == null )
@@ -269,7 +265,7 @@ public abstract class AbstractFromConfig
     }
 
     /**
-     * Tries to find missing version from dependancy list and dependency management. If found, the artifact is updated
+     * Tries to find missing version from dependency list and dependency management. If found, the artifact is updated
      * with the correct version. It will first look for an exact match on artifactId/groupId/classifier/type and if it
      * doesn't find a match, it will try again looking for artifactId and groupId only.
      * 
@@ -280,13 +276,11 @@ public abstract class AbstractFromConfig
         throws MojoExecutionException
     {
         if ( !findDependencyVersion( artifact, project.getDependencies(), false )
-            && ( project.getDependencyManagement() == null || !findDependencyVersion(
-                                                                                      artifact,
+            && ( project.getDependencyManagement() == null || !findDependencyVersion( artifact,
                                                                                       project.getDependencyManagement().getDependencies(),
                                                                                       false ) )
             && !findDependencyVersion( artifact, project.getDependencies(), true )
-            && ( project.getDependencyManagement() == null || !findDependencyVersion(
-                                                                                      artifact,
+            && ( project.getDependencyManagement() == null || !findDependencyVersion( artifact,
                                                                                       project.getDependencyManagement().getDependencies(),
                                                                                       true ) ) )
         {
@@ -300,17 +294,16 @@ public abstract class AbstractFromConfig
      * version.
      * 
      * @param artifact representing configured file.
-     * @param list list of dependencies to search.
+     * @param dependencies list of dependencies to search.
      * @param looseMatch only look at artifactId and groupId
      * @return the found dependency
      */
-    private boolean findDependencyVersion( ArtifactItem artifact, List list, boolean looseMatch )
+    private boolean findDependencyVersion( ArtifactItem artifact, List<Dependency> dependencies, boolean looseMatch )
     {
         boolean result = false;
 
-        for ( int i = 0; i < list.size(); i++ )
+        for ( Dependency dependency : dependencies )
         {
-            Dependency dependency = (Dependency) list.get( i );
             if ( StringUtils.equals( dependency.getArtifactId(), artifact.getArtifactId() )
                 && StringUtils.equals( dependency.getGroupId(), artifact.getGroupId() )
                 && ( looseMatch || StringUtils.equals( dependency.getClassifier(), artifact.getClassifier() ) )
@@ -373,7 +366,7 @@ public abstract class AbstractFromConfig
     /**
      * @return Returns the artifactItems.
      */
-    public ArrayList getArtifactItems()
+    public List<ArtifactItem> getArtifactItems()
     {
         return this.artifactItems;
     }
@@ -381,7 +374,7 @@ public abstract class AbstractFromConfig
     /**
      * @param theArtifactItems The artifactItems to set.
      */
-    public void setArtifactItems( ArrayList theArtifactItems )
+    public void setArtifactItems( List<ArtifactItem> theArtifactItems )
     {
         this.artifactItems = theArtifactItems;
     }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java Sun Mar 13 00:17:39 2011
@@ -20,8 +20,7 @@ package org.apache.maven.plugin.dependen
  */
 
 import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.List;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.dependency.utils.filters.ArtifactItemFilter;
@@ -62,11 +61,9 @@ public class CopyMojo
     {
         if ( !isSkip() )
         {
-            ArrayList theArtifactItems = getProcessedArtifactItems( this.stripVersion );
-            Iterator iter = theArtifactItems.iterator();
-            while ( iter.hasNext() )
+            List<ArtifactItem> theArtifactItems = getProcessedArtifactItems( this.stripVersion );
+            for ( ArtifactItem artifactItem : theArtifactItems )
             {
-                ArtifactItem artifactItem = (ArtifactItem) iter.next();
                 if ( artifactItem.isNeedsProcessing() )
                 {
                     copyArtifact( artifactItem );
@@ -97,9 +94,9 @@ public class CopyMojo
 
     protected ArtifactItemFilter getMarkedArtifactFilter( ArtifactItem item )
     {
-        ArtifactItemFilter destinationNameOverrideFilter = new DestFileFilter( this.isOverWriteReleases(), this
-            .isOverWriteSnapshots(), this.isOverWriteIfNewer(), false, false, false, false, this.stripVersion, item
-            .getOutputDirectory() );
+        ArtifactItemFilter destinationNameOverrideFilter =
+            new DestFileFilter( this.isOverWriteReleases(), this.isOverWriteSnapshots(), this.isOverWriteIfNewer(),
+                                false, false, false, false, this.stripVersion, item.getOutputDirectory() );
         return destinationNameOverrideFilter;
     }
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java Sun Mar 13 00:17:39 2011
@@ -20,8 +20,7 @@ package org.apache.maven.plugin.dependen
  */
 
 import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.List;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.dependency.utils.filters.ArtifactItemFilter;
@@ -84,11 +83,9 @@ public final class UnpackMojo
     {
         if ( !isSkip() )
         {
-            ArrayList processedItems = getProcessedArtifactItems( false );
-            Iterator iter = processedItems.iterator();
-            while ( iter.hasNext() )
+            List<ArtifactItem> processedItems = getProcessedArtifactItems( false );
+            for ( ArtifactItem artifactItem : processedItems )
             {
-                ArtifactItem artifactItem = (ArtifactItem) iter.next();
                 if ( artifactItem.isNeedsProcessing() )
                 {
                     unpackArtifact( artifactItem );
@@ -128,14 +125,12 @@ public final class UnpackMojo
                                      this.isOverWriteIfNewer(), handler );
     }
 
-    protected ArrayList getProcessedArtifactItems( boolean removeVersion )
+    protected List<ArtifactItem> getProcessedArtifactItems( boolean removeVersion )
         throws MojoExecutionException
     {
-        ArrayList items = super.getProcessedArtifactItems( removeVersion );
-        Iterator iter = items.iterator();
-        while ( iter.hasNext() )
+        List<ArtifactItem> items = super.getProcessedArtifactItems( removeVersion );
+        for ( ArtifactItem artifactItem : items )
         {
-            ArtifactItem artifactItem = (ArtifactItem) iter.next();
             if ( StringUtils.isEmpty( artifactItem.getIncludes() ) )
             {
                 artifactItem.setIncludes( getIncludes() );

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java Sun Mar 13 00:17:39 2011
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.resolvers;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -18,7 +19,6 @@ package org.apache.maven.plugin.dependen
  * under the License.    
  */
 
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -53,13 +53,13 @@ public class GoOfflineMojo
     public void execute()
         throws MojoExecutionException
     {
-        Set artifacts = project.getArtifacts();
+        Set<Artifact> artifacts = project.getArtifacts();
 
         if ( !silent )
         {
-            for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+            for ( Artifact artifact : artifacts )
             {
-                this.getLog().info( "Resolved: " + DependencyUtil.getFormattedFileName( (Artifact) i.next(), false ) );
+                this.getLog().info( "Resolved: " + DependencyUtil.getFormattedFileName( artifact, false ) );
             }
         }
     }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java Sun Mar 13 00:17:39 2011
@@ -61,9 +61,9 @@ public class ListRepositoriesMojo
 					new ScopeArtifactFilter( Artifact.SCOPE_TEST ),
 					new ArrayList() );
 			HashSet repos = new HashSet();
-            for ( Iterator i = result.getArtifactResolutionNodes().iterator(); i.hasNext(); )
+            for ( Iterator<ResolutionNode> i = result.getArtifactResolutionNodes().iterator(); i.hasNext(); )
 			{
-				ResolutionNode node = (ResolutionNode) i.next();
+				ResolutionNode node = i.next();
                 repos.addAll( node.getRemoteRepositories() );
 			}
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java Sun Mar 13 00:17:39 2011
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.dependen
  */
 
 import java.io.IOException;
-import java.util.Iterator;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -73,19 +72,15 @@ public class ResolveDependencySourcesMoj
         SourcesFileMarkerHandler handler = new SourcesFileMarkerHandler( this.markersDirectory );
         handler.setResolved( true );
 
-        Iterator iter = results.getResolvedDependencies().iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : results.getResolvedDependencies() )
         {
-            Artifact artifact = (Artifact) iter.next();
             handler.setArtifact( artifact );
             handler.setMarker();
         }
 
         handler.setResolved( false );
-        iter = results.getUnResolvedDependencies().iterator();
-        while ( iter.hasNext() )
+        for ( Artifact artifact : results.getUnResolvedDependencies() )
         {
-            Artifact artifact = (Artifact) iter.next();
             handler.setArtifact( artifact );
             handler.setMarker();
         }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java Sun Mar 13 00:17:39 2011
@@ -19,7 +19,6 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.io.Writer;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -78,7 +77,7 @@ public class ResolvePluginsMojo
 
         try
         {
-            Set plugins = resolvePluginArtifacts();
+            Set<Artifact> plugins = resolvePluginArtifacts();
 
             if ( this.outputFile != null )
             {
@@ -87,10 +86,8 @@ public class ResolvePluginsMojo
                 outputWriter = new FileWriter( outputFile );
             }
 
-            for ( Iterator i = plugins.iterator(); i.hasNext(); )
+            for ( Artifact plugin : plugins )
             {
-                Artifact plugin = (Artifact) i.next();
-
                 String logStr = "Plugin Resolved: " + DependencyUtil.getFormattedFileName( plugin, false );
                 if ( !silent )
                 {
@@ -105,12 +102,10 @@ public class ResolvePluginsMojo
 
                 if ( !excludeTransitive )
                 {
-                    Set transitiveDependencies = this.resolveArtifactDependencies( plugin );
-
-                    for ( Iterator transIter = transitiveDependencies.iterator(); transIter.hasNext(); )
+                    for ( Artifact artifact : resolveArtifactDependencies( plugin ) )
                     {
-                        logStr = "    Plugin Dependency Resolved: "
-                            + DependencyUtil.getFormattedFileName( (Artifact) transIter.next(), false );
+                        logStr =
+                            "    Plugin Dependency Resolved: " + DependencyUtil.getFormattedFileName( artifact, false );
 
                         if ( !silent )
                         {
@@ -172,19 +167,18 @@ public class ResolvePluginsMojo
      * @throws ArtifactResolutionException
      * @throws ArtifactNotFoundException
      */
-    protected Set resolvePluginArtifacts()
+    protected Set<Artifact> resolvePluginArtifacts()
         throws ArtifactResolutionException, ArtifactNotFoundException
     {
-        Set plugins = project.getPluginArtifacts();
-        Set reports = project.getReportArtifacts();
+        Set<Artifact> plugins = project.getPluginArtifacts();
+        Set<Artifact> reports = project.getReportArtifacts();
 
-        Set artifacts = new HashSet();
+        Set<Artifact> artifacts = new HashSet<Artifact>();
         artifacts.addAll( reports );
         artifacts.addAll( plugins );
 
-        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+        for ( Artifact artifact : artifacts )
         {
-            Artifact artifact = (Artifact) i.next();
             // resolve the new artifact
             this.resolver.resolve( artifact, this.remotePluginRepositories, this.getLocal() );
         }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/DOTDependencyNodeVisitor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/DOTDependencyNodeVisitor.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/DOTDependencyNodeVisitor.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/DOTDependencyNodeVisitor.java Sun Mar 13 00:17:39 2011
@@ -24,7 +24,6 @@ import org.apache.maven.shared.dependenc
 
 import java.io.Writer;
 import java.util.List;
-import java.util.Iterator;
 
 /**
  * A dependency node visitor that serializes visited nodes to DOT format
@@ -59,17 +58,17 @@ public class DOTDependencyNodeVisitor ex
 
         // Generate "currentNode -> Child" lines
 
-        List children = node.getChildren() ;
+        List<DependencyNode> children = node.getChildren();
 
-        for ( Iterator it = children.iterator () ; it.hasNext (); )
+        for ( DependencyNode child : children )
         {
-            StringBuffer sb = new StringBuffer() ;
-            sb.append( "\t\"" ) ;
-            sb.append(node.toNodeString()) ;
-            sb.append( "\" -> \"" ) ;
-            sb.append( ((DependencyNode)it.next()).toNodeString() ) ;
-            sb.append( "\" ; " ) ;
-            writer.println( sb.toString() ) ;
+            StringBuffer sb = new StringBuffer();
+            sb.append( "\t\"" );
+            sb.append( node.toNodeString() );
+            sb.append( "\" -> \"" );
+            sb.append( child.toNodeString() );
+            sb.append( "\" ; " );
+            writer.println( sb.toString() );
         }
 
         return true;

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/TGFDependencyNodeVisitor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/TGFDependencyNodeVisitor.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/TGFDependencyNodeVisitor.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/treeSerializers/TGFDependencyNodeVisitor.java Sun Mar 13 00:17:39 2011
@@ -21,7 +21,6 @@ package org.apache.maven.plugin.dependen
 
 import java.io.Writer;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.maven.shared.dependency.tree.DependencyNode;
@@ -95,7 +94,7 @@ public class TGFDependencyNodeVisitor ex
     /**
      * List of edges.
      */
-    private List edges = new ArrayList();
+    private List<EdgeAppender> edges = new ArrayList<EdgeAppender>();
 
     /**
      * Constructor.
@@ -116,9 +115,9 @@ public class TGFDependencyNodeVisitor ex
         {
             // dump edges on last node endVisit
             writer.println( "#" );
-            for ( Iterator iterator = edges.iterator(); iterator.hasNext(); )
+            for ( EdgeAppender edge : edges )
             {
-                writer.println( iterator.next().toString() );
+                writer.println( edge.toString() );
             }
         }
         else

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java Sun Mar 13 00:17:39 2011
@@ -23,7 +23,6 @@ package org.apache.maven.plugin.dependen
  *
  */
 
-import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
@@ -36,37 +35,37 @@ import org.apache.maven.artifact.Artifac
 public class DependencyStatusSets
 {
 
-    Set resolvedDependencies = null;
+    Set<Artifact> resolvedDependencies = null;
 
-    Set unResolvedDependencies = null;
+    Set<Artifact> unResolvedDependencies = null;
 
-    Set skippedDependencies = null;
+    Set<Artifact> skippedDependencies = null;
 
     public DependencyStatusSets()
     {
 
     }
 
-    public DependencyStatusSets( Set resolved, Set unResolved, Set skipped )
+    public DependencyStatusSets( Set<Artifact> resolved, Set<Artifact> unResolved, Set<Artifact> skipped )
     {
         if ( resolved != null )
         {
-            this.resolvedDependencies = new LinkedHashSet( resolved );
+            this.resolvedDependencies = new LinkedHashSet<Artifact>( resolved );
         }
         if ( unResolved != null )
         {
-            this.unResolvedDependencies = new LinkedHashSet( unResolved );
+            this.unResolvedDependencies = new LinkedHashSet<Artifact>( unResolved );
         }
         if ( skipped != null )
         {
-            this.skippedDependencies = new LinkedHashSet( skipped );
+            this.skippedDependencies = new LinkedHashSet<Artifact>( skipped );
         }
     }
 
     /**
      * @return Returns the resolvedDependencies.
      */
-    public Set getResolvedDependencies()
+    public Set<Artifact> getResolvedDependencies()
     {
         return this.resolvedDependencies;
     }
@@ -75,11 +74,11 @@ public class DependencyStatusSets
      * @param resolvedDependencies
      *            The resolvedDependencies to set.
      */
-    public void setResolvedDependencies( Set resolvedDependencies )
+    public void setResolvedDependencies( Set<Artifact> resolvedDependencies )
     {
         if ( resolvedDependencies != null )
         {
-            this.resolvedDependencies = new LinkedHashSet( resolvedDependencies );
+            this.resolvedDependencies = new LinkedHashSet<Artifact>( resolvedDependencies );
         }
         else
         {
@@ -90,7 +89,7 @@ public class DependencyStatusSets
     /**
      * @return Returns the skippedDependencies.
      */
-    public Set getSkippedDependencies()
+    public Set<Artifact> getSkippedDependencies()
     {
         return this.skippedDependencies;
     }
@@ -99,11 +98,11 @@ public class DependencyStatusSets
      * @param skippedDependencies
      *            The skippedDependencies to set.
      */
-    public void setSkippedDependencies( Set skippedDependencies )
+    public void setSkippedDependencies( Set<Artifact> skippedDependencies )
     {
         if ( skippedDependencies != null )
         {
-            this.skippedDependencies = new LinkedHashSet( skippedDependencies );
+            this.skippedDependencies = new LinkedHashSet<Artifact>( skippedDependencies );
         }
         else
         {
@@ -114,7 +113,7 @@ public class DependencyStatusSets
     /**
      * @return Returns the unResolvedDependencies.
      */
-    public Set getUnResolvedDependencies()
+    public Set<Artifact> getUnResolvedDependencies()
     {
         return this.unResolvedDependencies;
     }
@@ -123,11 +122,11 @@ public class DependencyStatusSets
      * @param unResolvedDependencies
      *            The unResolvedDependencies to set.
      */
-    public void setUnResolvedDependencies( Set unResolvedDependencies )
+    public void setUnResolvedDependencies( Set<Artifact> unResolvedDependencies )
     {
         if ( unResolvedDependencies != null )
         {
-            this.unResolvedDependencies = new LinkedHashSet( unResolvedDependencies );
+            this.unResolvedDependencies = new LinkedHashSet<Artifact>( unResolvedDependencies );
         }
         else
         {
@@ -151,9 +150,8 @@ public class DependencyStatusSets
         }
         else
         {
-            for ( Iterator i = resolvedDependencies.iterator(); i.hasNext(); )
+            for ( Artifact artifact : resolvedDependencies )
             {
-                Artifact artifact = (Artifact) i.next();
                 String artifactFilename = null;
                 if ( outputAbsoluteArtifactFilename )
                 {
@@ -179,11 +177,11 @@ public class DependencyStatusSets
         {
             sb.append( "\n" );
             sb.append( "The following files were skipped:\n" );
-            Set skippedDependencies = new LinkedHashSet();
+            Set<Artifact> skippedDependencies = new LinkedHashSet<Artifact>();
             skippedDependencies.addAll( this.skippedDependencies );
-            for ( Iterator i = skippedDependencies.iterator(); i.hasNext(); )
+            for ( Artifact artifact : skippedDependencies )
             {
-                sb.append( "   " + ( (Artifact) i.next() ).getId() + "\n" );
+                sb.append( "   " + artifact.getId() + "\n" );
             }
         }
 
@@ -191,11 +189,11 @@ public class DependencyStatusSets
         {
             sb.append( "\n" );
             sb.append( "The following files have NOT been resolved:\n" );
-            Set unResolvedDependencies = new LinkedHashSet();
+            Set<Artifact> unResolvedDependencies = new LinkedHashSet<Artifact>();
             unResolvedDependencies.addAll( this.unResolvedDependencies );
-            for ( Iterator i = unResolvedDependencies.iterator(); i.hasNext(); )
+            for ( Artifact artifact : unResolvedDependencies )
             {
-                sb.append( "   " + ( (Artifact) i.next() ).getId() + "\n" );
+                sb.append( "   " + artifact.getId() + "\n" );
             }
         }
         sb.append( "\n" );

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java Sun Mar 13 00:17:39 2011
@@ -94,13 +94,13 @@ public class DestFileFilter
     public Set filter( Set artifacts )
         throws ArtifactFilterException
     {
-        Set result = new HashSet();
+        Set<Artifact> result = new HashSet<Artifact>();
 
-        Iterator iter = artifacts.iterator();
+        Iterator<Artifact> iter = artifacts.iterator();
         
         while ( iter.hasNext() )
         {
-            Artifact artifact = (Artifact) iter.next();
+            Artifact artifact = iter.next();
             if ( isArtifactIncluded( new ArtifactItem( artifact ) ) )
             {
                 result.add( artifact );

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java?rev=1081021&r1=1081020&r2=1081021&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java Sun Mar 13 00:17:39 2011
@@ -65,13 +65,13 @@ public class MarkerFileFilter
     public Set filter( Set artifacts )
         throws ArtifactFilterException
     {
-        Set result = new HashSet();
+        Set<Artifact> result = new HashSet<Artifact>();
 
-        Iterator iter = artifacts.iterator();
+        Iterator<Artifact> iter = artifacts.iterator();
 
         while ( iter.hasNext() )
         {
-            Artifact artifact = (Artifact) iter.next();
+            Artifact artifact = iter.next();
             if ( isArtifactIncluded( new ArtifactItem( artifact ) ) )
             {
                 result.add( artifact );



Mime
View raw message