You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2012/12/16 19:16:14 UTC
svn commit: r1422650 - in
/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy:
DeployFileMojo.java DeployMojo.java
Author: rfscholte
Date: Sun Dec 16 18:16:12 2012
New Revision: 1422650
URL: http://svn.apache.org/viewvc?rev=1422650&view=rev
Log:
Apply generics and foreach loops
Modified:
maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java?rev=1422650&r1=1422649&r2=1422650&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java Sun Dec 16 18:16:12 2012
@@ -19,6 +19,13 @@ package org.apache.maven.plugin.deploy;
* under the License.
*/
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.List;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
@@ -45,14 +52,6 @@ import org.codehaus.plexus.util.StringUt
import org.codehaus.plexus.util.WriterFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.List;
-
/**
* Installs the artifact in the remote repository.
*
@@ -377,12 +376,11 @@ public class DeployFileMojo
}
}
- List attachedArtifacts = project.getAttachedArtifacts();
+ @SuppressWarnings( "unchecked" )
+ List<Artifact> attachedArtifacts = project.getAttachedArtifacts();
- for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); )
+ for ( Artifact attached : attachedArtifacts)
{
- Artifact attached = ( Artifact ) i.next();
-
try
{
deploy( attached.getFile(), attached, deploymentRepository, getLocalRepository() );
Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java?rev=1422650&r1=1422649&r2=1422650&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java Sun Dec 16 18:16:12 2012
@@ -34,7 +34,6 @@ import org.apache.maven.project.MavenPro
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
import java.io.File;
-import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -150,7 +149,9 @@ public class DeployMojo
Artifact artifact = project.getArtifact();
String packaging = project.getPackaging();
File pomFile = project.getFile();
- List attachedArtifacts = project.getAttachedArtifacts();
+
+ @SuppressWarnings( "unchecked" )
+ List<Artifact> attachedArtifacts = project.getAttachedArtifacts();
ArtifactRepository repo = getDeploymentRepository( project );
@@ -219,10 +220,8 @@ public class DeployMojo
}
}
- for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); )
+ for ( Artifact attached : attachedArtifacts )
{
- Artifact attached = ( Artifact ) i.next();
-
deploy( attached.getFile(), attached, repo, getLocalRepository() );
}
}