maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1229755 - /maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
Date Tue, 10 Jan 2012 21:58:14 GMT
Author: rfscholte
Date: Tue Jan 10 21:58:14 2012
New Revision: 1229755

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

Modified:
    maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java

Modified: maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java?rev=1229755&r1=1229754&r2=1229755&view=diff
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
(original)
+++ maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
Tue Jan 10 21:58:14 2012
@@ -153,7 +153,7 @@ public abstract class AbstractReleaseMoj
      * @parameter
      * @since 2.0-beta-6
      */
-    private Map providerImplementations;
+    private Map<String, String> providerImplementations;
 
     /**
      * The M2_HOME parameter to use for forked Maven invocations.
@@ -245,10 +245,9 @@ public abstract class AbstractReleaseMoj
     {
         if ( providerImplementations != null )
         {
-            for ( Iterator i = providerImplementations.keySet().iterator(); i.hasNext();
)
+            for ( String providerType : providerImplementations.keySet() )
             {
-                String providerType = (String) i.next();
-                String providerImplementation = (String) providerImplementations.get( providerType
);
+                String providerImplementation = providerImplementations.get( providerType
);
                 getLog().info( "Change the default '" + providerType + "' provider implementation
to '"
                     + providerImplementation + "'." );
                 scmManager.setScmProviderImplementation( providerType, providerImplementation
);
@@ -282,7 +281,8 @@ public abstract class AbstractReleaseMoj
         
         descriptor.setPushChanges( pushChanges );
 
-        List profiles = project.getActiveProfiles();
+        @SuppressWarnings("unchecked")
+		List<Profile> profiles = project.getActiveProfiles();
 
         String arguments = this.arguments;
         if ( profiles != null && !profiles.isEmpty() )
@@ -296,9 +296,9 @@ public abstract class AbstractReleaseMoj
                 arguments = "-P ";
             }
 
-            for ( Iterator it = profiles.iterator(); it.hasNext(); )
+            for ( Iterator<Profile> it = profiles.iterator(); it.hasNext(); )
             {
-                Profile profile = (Profile) it.next();
+                Profile profile = it.next();
 
                 arguments += profile.getId();
                 if ( it.hasNext() )



Mime
View raw message