[prev in list] [next in list] [prev in thread] [next in thread] 

List:       maven-dev
Subject:    svn commit: r1508988 - in /maven/plugins/trunk/maven-install-plugin/src: main/java/org/apache/maven/
From:       krosenvold () apache ! org
Date:       2013-07-31 18:54:52
Message-ID: 20130731185453.0093A2388906 () eris ! apache ! org
[Download RAW message or body]

Author: krosenvold
Date: Wed Jul 31 18:54:52 2013
New Revision: 1508988

URL: http://svn.apache.org/r1508988
Log:
Fixed various java5 stuff

Modified:
    maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java
  maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java
  maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java
  maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/InstallFileMojoTest.java
  maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/InstallMojoTest.java
  maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/stubs/InstallArtifactStub.java


Modified: maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java
                
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/main/ja \
va/org/apache/maven/plugin/install/AbstractInstallMojo.java?rev=1508988&r1=1508987&r2=1508988&view=diff
 ==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java \
                (original)
+++ maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java \
Wed Jul 31 18:54:52 2013 @@ -180,7 +180,7 @@ public abstract class AbstractInstallMoj
      *            file extension, must not be <code>null</code>.
      * @param ext The file extension (including the leading dot) to use for the \
                checksum file, must not be
      *            <code>null</code>.
-     * @param checksum
+     * @param checksum  the checksum to write
      * @throws MojoExecutionException If the checksum could not be installed.
      */
     private void installChecksum( File installedFile, String ext, String checksum )

Modified: maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java
                
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/main/ja \
va/org/apache/maven/plugin/install/InstallFileMojo.java?rev=1508988&r1=1508987&r2=1508988&view=diff
 ==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java \
                (original)
+++ maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java \
Wed Jul 31 18:54:52 2013 @@ -152,6 +152,7 @@ public class InstallFileMojo
     /**
      * Map that contains the repository layouts.
      */
+    @SuppressWarnings( "MismatchedQueryAndUpdateOfCollection" )
     @Component( role = ArtifactRepositoryLayout.class )
     private Map<String, ArtifactRepositoryLayout> repositoryLayouts;
 
@@ -191,9 +192,10 @@ public class InstallFileMojo
         {
             try
             {
-                ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) \
repositoryLayouts.get( repositoryLayout ); +                ArtifactRepositoryLayout \
layout = repositoryLayouts.get( repositoryLayout );  getLog().debug( "Layout: " + \
layout.getClass() );  
+                //noinspection deprecation
                 localRepository =
                     new DefaultArtifactRepository( localRepository.getId(), \
localRepositoryPath.toURL().toString(),  layout );
@@ -323,6 +325,7 @@ public class InstallFileMojo
         {
             if ( generatedPomFile != null )
             {
+                //noinspection ResultOfMethodCallIgnored
                 generatedPomFile.delete();
             }
         }
@@ -536,6 +539,7 @@ public class InstallFileMojo
     /**
      * @return the localRepositoryPath
      */
+    @SuppressWarnings( "UnusedDeclaration" )
     public File getLocalRepositoryPath()
     {
         return this.localRepositoryPath;

Modified: maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java
                
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/main/ja \
va/org/apache/maven/plugin/install/InstallMojo.java?rev=1508988&r1=1508987&r2=1508988&view=diff
 ==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java \
                (original)
+++ maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java \
Wed Jul 31 18:54:52 2013 @@ -51,6 +51,7 @@ public class InstallMojo
     @Component
     private MavenProject project;
     
+    @SuppressWarnings( "MismatchedQueryAndUpdateOfCollection" )
     @Parameter( defaultValue = "${reactorProjects}", required = true, readonly = \
true )  private List<MavenProject> reactorProjects;
     
@@ -139,7 +140,7 @@ public class InstallMojo
         // TODO: push into transformation
         boolean isPomArtifact = "pom".equals( packaging );
 
-        ArtifactMetadata metadata = null;
+        ArtifactMetadata metadata;
 
         if ( updateReleaseInfo )
         {

Modified: maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/InstallFileMojoTest.java
                
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/test/ja \
va/org/apache/maven/plugin/install/InstallFileMojoTest.java?rev=1508988&r1=1508987&r2=1508988&view=diff
 ==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/InstallFileMojoTest.java \
                (original)
+++ maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/InstallFileMojoTest.java \
Wed Jul 31 18:54:52 2013 @@ -148,7 +148,7 @@ public class InstallFileMojoTest
         File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" \
+ artifactId + "/" + version + "/" +  artifactId + "-" + version + "." + packaging );
 
-        assertTrue( ( (Boolean) getVariableValueFromObject( mojo, "generatePom" ) \
).booleanValue() ); +        assertTrue( (Boolean) getVariableValueFromObject( mojo, \
"generatePom" ) );  
         assertTrue( installedArtifact.exists() );
 
@@ -242,7 +242,7 @@ public class InstallFileMojoTest
 
         assignValuesForParameter( mojo );
 
-        boolean createChecksum = ( (Boolean) getVariableValueFromObject( mojo, \
"createChecksum" ) ).booleanValue(); +        boolean createChecksum = (Boolean) \
getVariableValueFromObject( mojo, "createChecksum" );  
         assertTrue( createChecksum );
 
@@ -250,7 +250,7 @@ public class InstallFileMojoTest
 
         //get the actual checksum of the artifact
         mojo.digester.calculate( file );
-        String actualMd5Sum = mojo.digester.getMd5( );
+        String actualMd5Sum = mojo.digester.getMd5();
         String actualSha1Sum = mojo.digester.getSha1();
 
         String localPath = getBasedir() + "/" + LOCAL_REPO + groupId + "/" + \
artifactId + "/" + version + "/" +

Modified: maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/InstallMojoTest.java
                
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/test/ja \
va/org/apache/maven/plugin/install/InstallMojoTest.java?rev=1508988&r1=1508987&r2=1508988&view=diff
 ==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/InstallMojoTest.java \
                (original)
+++ maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/InstallMojoTest.java \
Wed Jul 31 18:54:52 2013 @@ -29,7 +29,6 @@ import org.apache.maven.project.MavenPro
 import org.apache.maven.shared.utils.io.FileUtils;
 
 import java.io.File;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -112,11 +111,11 @@ public class InstallMojoTest
 
         String packaging = project.getPackaging();
 
-        String groupId = "";
+        String groupId;
 
-        for ( Iterator iter = attachedArtifacts.iterator(); iter.hasNext(); )
+        for ( Object attachedArtifact1 : attachedArtifacts )
         {
-            AttachedArtifactStub0 attachedArtifact = (AttachedArtifactStub0) \
iter.next(); +            AttachedArtifactStub0 attachedArtifact = \
(AttachedArtifactStub0) attachedArtifact1;  
             groupId = dotToSlashReplacer( attachedArtifact.getGroupId() );
 
@@ -223,7 +222,7 @@ public class InstallMojoTest
 
         artifact = (InstallArtifactStub) project.getArtifact();
         
-        boolean createChecksum = ( (Boolean) getVariableValueFromObject( mojo, \
"createChecksum" ) ).booleanValue(); +        boolean createChecksum = (Boolean) \
getVariableValueFromObject( mojo, "createChecksum" );  
         assertTrue( createChecksum );
 
@@ -232,9 +231,9 @@ public class InstallMojoTest
         mojo.execute();
 
         ArtifactMetadata metadata = null;
-        for ( Iterator iter = artifact.getMetadataList().iterator(); iter.hasNext(); \
) +        for ( Object o : artifact.getMetadataList() )
         {
-            metadata = (ArtifactMetadata) iter.next();
+            metadata = (ArtifactMetadata) o;
             if ( metadata.getRemoteFilename().endsWith( "pom" ) )
             {
                 break;
@@ -250,7 +249,7 @@ public class InstallMojoTest
         //get the actual checksum of the pom
         mojo.digester.calculate( pom );
         String actualPomMd5Sum = mojo.digester.getMd5();
-        String actualPomSha1Sum = mojo.digester.getSha1( );
+        String actualPomSha1Sum = mojo.digester.getSha1();
 
         //get the actual checksum of the artifact
         mojo.digester.calculate( file );

Modified: maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/stubs/InstallArtifactStub.java
                
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/test/ja \
va/org/apache/maven/plugin/install/stubs/InstallArtifactStub.java?rev=1508988&r1=1508987&r2=1508988&view=diff
 ==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/stubs/InstallArtifactStub.java \
                (original)
+++ maven/plugins/trunk/maven-install-plugin/src/test/java/org/apache/maven/plugin/install/stubs/InstallArtifactStub.java \
Wed Jul 31 18:54:52 2013 @@ -34,7 +34,7 @@ import java.util.Map;
 public class InstallArtifactStub
     extends ArtifactStub
 {
-    private Map metadataMap;
+    private Map<Object,ArtifactMetadata> metadataMap;
 
     private File file;
 
@@ -85,10 +85,10 @@ public class InstallArtifactStub
     {
         if ( metadataMap == null )
         {
-            metadataMap = new HashMap();
+            metadataMap = new HashMap<Object, ArtifactMetadata>();
         }
 
-        ArtifactMetadata m = (ArtifactMetadata) metadataMap.get( metadata.getKey() \
); +        ArtifactMetadata m = metadataMap.get( metadata.getKey() );
         if ( m != null )
         {
             m.merge( metadata );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic