maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1230298 - in /maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release: config/ phase/
Date Wed, 11 Jan 2012 22:39:26 GMT
Author: rfscholte
Date: Wed Jan 11 22:39:25 2012
New Revision: 1230298

URL: http://svn.apache.org/viewvc?rev=1230298&view=rev
Log:
Again another set of generics

Modified:
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomVersionsPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForDevelopmentPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java?rev=1230298&r1=1230297&r2=1230298&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
Wed Jan 11 22:39:25 2012
@@ -210,27 +210,27 @@ public class ReleaseUtils
 
     private static void loadResolvedDependencies( Properties prop, ReleaseDescriptor descriptor
)
     {
-        Map resolvedDependencies = new HashMap();
+        Map<String, Map<String, String>> resolvedDependencies = new HashMap<String,
Map<String, String>>();
 
         Set entries = prop.entrySet();
-        Iterator iterator = entries.iterator();
+        Iterator<Entry<String, String>> iterator = entries.iterator();
         String propertyName;
-        Entry currentEntry;
+        Entry<String, String> currentEntry;
 
         while ( iterator.hasNext() )
         {
-            currentEntry = (Entry) iterator.next();
+            currentEntry = iterator.next();
             propertyName = (String) currentEntry.getKey();
 
             if ( propertyName.startsWith( "dependency." ) )
             {
-                Map versionMap;
+                Map<String, String> versionMap;
                 String artifactVersionlessKey;
                 int startIndex;
                 int endIndex;
                 String versionType;
 
-                versionMap = new HashMap();
+                versionMap = new HashMap<String, String>();
                 startIndex = propertyName.lastIndexOf( "dependency." );
 
                 if ( propertyName.indexOf( ".development" ) != -1 )
@@ -248,11 +248,11 @@ public class ReleaseUtils
 
                 if ( resolvedDependencies.containsKey( artifactVersionlessKey ) )
                 {
-                    versionMap = (Map) resolvedDependencies.get( artifactVersionlessKey );
+                    versionMap = resolvedDependencies.get( artifactVersionlessKey );
                 }
                 else
                 {
-                    versionMap = new HashMap();
+                    versionMap = new HashMap<String, String>();
                     resolvedDependencies.put( artifactVersionlessKey, versionMap );
                 }
 

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java?rev=1230298&r1=1230297&r2=1230298&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
Wed Jan 11 22:39:25 2012
@@ -253,7 +253,8 @@ public abstract class AbstractRewritePom
         Namespace namespace = rootElement.getNamespace();
         Map<String, String> mappedVersions = getNextVersionMap( releaseDescriptor );
         Map<String, String> originalVersions = getOriginalVersionMap( releaseDescriptor,
reactorProjects, simulate );
-        Map resolvedSnapshotDependencies = releaseDescriptor.getResolvedSnapshotDependencies();
+        @SuppressWarnings("unchecked")
+		Map<String, Map<String, String>> resolvedSnapshotDependencies = releaseDescriptor.getResolvedSnapshotDependencies();
         Model model = project.getModel();
         Element properties = rootElement.getChild( "properties", namespace );
 
@@ -411,8 +412,8 @@ public abstract class AbstractRewritePom
         }
     }
 
-    private String rewriteParent( MavenProject project, Element rootElement, Namespace namespace,
Map mappedVersions,
-                                  Map resolvedSnapshotDependencies, Map originalVersions
)
+    private String rewriteParent( MavenProject project, Element rootElement, Namespace namespace,
Map<String, String> mappedVersions,
+                                  Map<String, Map<String, String>> resolvedSnapshotDependencies,
Map<String, String> originalVersions )
         throws ReleaseFailureException
     {
         String parentVersion = null;
@@ -422,7 +423,7 @@ public abstract class AbstractRewritePom
             Element versionElement = parentElement.getChild( "version", namespace );
             MavenProject parent = project.getParent();
             String key = ArtifactUtils.versionlessKey( parent.getGroupId(), parent.getArtifactId()
);
-            parentVersion = (String) mappedVersions.get( key );
+            parentVersion = mappedVersions.get( key );
             if ( parentVersion == null )
             {
                 //MRELEASE-317
@@ -444,7 +445,7 @@ public abstract class AbstractRewritePom
     }
 
     private void rewriteArtifactVersions( Collection<Element> elements, Map<String,
String> mappedVersions,
-                                          Map resolvedSnapshotDependencies, Map<String,
String> originalVersions,
+                                          Map<String, Map<String, String>> resolvedSnapshotDependencies,
Map<String, String> originalVersions,
                                           Model projectModel, Element properties, ReleaseResult
result,
                                           ReleaseDescriptor releaseDescriptor )
         throws ReleaseExecutionException, ReleaseFailureException
@@ -755,13 +756,13 @@ public abstract class AbstractRewritePom
                                           ScmRepository scmRepository, ReleaseResult result,
String commonBasedir )
         throws ReleaseExecutionException;
 
-    protected String getOriginalResolvedSnapshotVersion( String artifactVersionlessKey, Map
resolvedSnapshots )
+    protected String getOriginalResolvedSnapshotVersion( String artifactVersionlessKey, Map<String,
Map<String, String>> resolvedSnapshots )
     {
-        Map versionsMap = (Map) resolvedSnapshots.get( artifactVersionlessKey );
+        Map<String, String> versionsMap = resolvedSnapshots.get( artifactVersionlessKey
);
 
         if ( versionsMap != null )
         {
-            return (String) ( versionsMap.get( ReleaseDescriptor.ORIGINAL_VERSION ) );
+            return versionsMap.get( ReleaseDescriptor.ORIGINAL_VERSION );
         }
         else
         {

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java?rev=1230298&r1=1230297&r2=1230298&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java
Wed Jan 11 22:39:25 2012
@@ -89,7 +89,8 @@ public class CheckDependencySnapshotsPha
         {
             logInfo( result, "Checking dependencies and plugins for snapshots ..." );
 
-            Map originalVersions = releaseDescriptor.getOriginalVersions( reactorProjects
);
+            @SuppressWarnings("unchecked")
+			Map<String, String> originalVersions = releaseDescriptor.getOriginalVersions( reactorProjects
);
 
             for ( MavenProject project : reactorProjects )
             {
@@ -105,7 +106,7 @@ public class CheckDependencySnapshotsPha
         return result;
     }
 
-    private void checkProject( MavenProject project, Map originalVersions, ReleaseDescriptor
releaseDescriptor )
+    private void checkProject( MavenProject project, Map<String, String> originalVersions,
ReleaseDescriptor releaseDescriptor )
         throws ReleaseFailureException, ReleaseExecutionException
     {
         @SuppressWarnings("unchecked")
@@ -258,7 +259,7 @@ public class CheckDependencySnapshotsPha
         }
     }
 
-    private static boolean checkArtifact( Artifact artifact, Map originalVersions, Map<String,
Artifact> artifactMapByVersionlessId, ReleaseDescriptor releaseDescriptor )
+    private static boolean checkArtifact( Artifact artifact, Map<String, String> originalVersions,
Map<String, Artifact> artifactMapByVersionlessId, ReleaseDescriptor releaseDescriptor
)
     {
         Artifact checkArtifact = getArtifactFromMap( artifact, artifactMapByVersionlessId
);
 
@@ -277,7 +278,7 @@ public class CheckDependencySnapshotsPha
         return checkArtifact;
     }
 
-    private static boolean checkArtifact( Artifact artifact, Map originalVersions, ReleaseDescriptor
releaseDescriptor )
+    private static boolean checkArtifact( Artifact artifact, Map<String, String> originalVersions,
ReleaseDescriptor releaseDescriptor )
     {
         String versionlessArtifactKey = ArtifactUtils.versionlessKey( artifact.getGroupId(),
artifact.getArtifactId() );
 

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java?rev=1230298&r1=1230297&r2=1230298&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
Wed Jan 11 22:39:25 2012
@@ -24,7 +24,6 @@ import java.io.IOException;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -302,14 +301,14 @@ public class GenerateReleasePomsPhase
         return releaseDescriptor.getReleaseVersions();
     }
 
-    private String getNextVersion( Map mappedVersions, String groupId, String artifactId,
String version )
+    private String getNextVersion( Map<String, String> mappedVersions, String groupId,
String artifactId, String version )
         throws ReleaseFailureException
     {
         // TODO: share with RewritePomsForReleasePhase.rewriteVersion
 
         String id = ArtifactUtils.versionlessKey( groupId, artifactId );
 
-        String nextVersion = (String) mappedVersions.get( id );
+        String nextVersion = mappedVersions.get( id );
 
         if ( nextVersion == null )
         {
@@ -363,7 +362,8 @@ public class GenerateReleasePomsPhase
     private List<Dependency> createReleaseDependencies( Map<String, String> originalVersions,
Map<String, String> mappedVersions, MavenProject project )
         throws ReleaseFailureException
     {
-        Set<Artifact> artifacts = project.getArtifacts();
+        @SuppressWarnings("unchecked")
+		Set<Artifact> artifacts = project.getArtifacts();
 
         List<Dependency> releaseDependencies = null;
 
@@ -484,11 +484,13 @@ public class GenerateReleasePomsPhase
 
         if ( reporting != null )
         {
-            List<ReportPlugin> reportPlugins = reporting.getPlugins();
+            @SuppressWarnings("unchecked")
+			List<ReportPlugin> reportPlugins = reporting.getPlugins();
 
             if ( reportPlugins != null )
             {
-                Map<String, Artifact> artifactsById = project.getReportArtifactMap();
+                @SuppressWarnings("unchecked")
+				Map<String, Artifact> artifactsById = project.getReportArtifactMap();
 
                 releaseReportPlugins = new ArrayList<ReportPlugin>();
 
@@ -524,7 +526,8 @@ public class GenerateReleasePomsPhase
 
         if ( build != null )
         {
-            List<Extension> extensions = build.getExtensions();
+            @SuppressWarnings("unchecked")
+			List<Extension> extensions = build.getExtensions();
 
             if ( extensions != null )
             {

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomVersionsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomVersionsPhase.java?rev=1230298&r1=1230297&r2=1230298&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomVersionsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomVersionsPhase.java
Wed Jan 11 22:39:25 2012
@@ -47,13 +47,15 @@ public class RewritePomVersionsPhase
         // We are only updating versions no mods to scm needed
     }
 
-    protected Map<String, String> getOriginalVersionMap( ReleaseDescriptor releaseDescriptor,
List<MavenProject> reactorProjects,
+    @SuppressWarnings("unchecked")
+	protected Map<String, String> getOriginalVersionMap( ReleaseDescriptor releaseDescriptor,
List<MavenProject> reactorProjects,
                                          boolean simulate )
     {
         return releaseDescriptor.getReleaseVersions();
     }
 
-    protected Map<String, String> getNextVersionMap( ReleaseDescriptor releaseDescriptor
)
+    @SuppressWarnings("unchecked")
+	protected Map<String, String> getNextVersionMap( ReleaseDescriptor releaseDescriptor
)
     {
         return releaseDescriptor.getDevelopmentVersions();
     }

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java?rev=1230298&r1=1230297&r2=1230298&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
Wed Jan 11 22:39:25 2012
@@ -210,12 +210,14 @@ public class RewritePomsForBranchPhase
         return result;
     }
 
-    protected Map<String,String> getOriginalVersionMap( ReleaseDescriptor releaseDescriptor,
List<MavenProject> reactorProjects, boolean simulate )
+    @SuppressWarnings("unchecked")
+	protected Map<String,String> getOriginalVersionMap( ReleaseDescriptor releaseDescriptor,
List<MavenProject> reactorProjects, boolean simulate )
     {
         return releaseDescriptor.getOriginalVersions( reactorProjects );
     }
 
-    protected Map<String, String> getNextVersionMap( ReleaseDescriptor releaseDescriptor)
+    @SuppressWarnings("unchecked")
+	protected Map<String, String> getNextVersionMap( ReleaseDescriptor releaseDescriptor)
     {
         return releaseDescriptor.getReleaseVersions();
     }

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForDevelopmentPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForDevelopmentPhase.java?rev=1230298&r1=1230297&r2=1230298&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForDevelopmentPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForDevelopmentPhase.java
Wed Jan 11 22:39:25 2012
@@ -56,7 +56,8 @@ public class RewritePomsForDevelopmentPh
             Element scmRoot = rootElement.getChild( "scm", namespace );
             if ( scmRoot != null )
             {
-                Map<String, Scm> originalScmInfo = releaseDescriptor.getOriginalScmInfo();
+                @SuppressWarnings("unchecked")
+				Map<String, Scm> originalScmInfo = releaseDescriptor.getOriginalScmInfo();
                 // check containsKey, not == null, as we store null as a value
                 if ( !originalScmInfo.containsKey( projectId ) )
                 {
@@ -92,14 +93,16 @@ public class RewritePomsForDevelopmentPh
         }
     }
 
-    protected Map<String,String> getOriginalVersionMap( ReleaseDescriptor releaseDescriptor,
List<MavenProject> reactorProjects, boolean simulate )
+    @SuppressWarnings("unchecked")
+	protected Map<String,String> getOriginalVersionMap( ReleaseDescriptor releaseDescriptor,
List<MavenProject> reactorProjects, boolean simulate )
     {
         return simulate
             ? releaseDescriptor.getOriginalVersions( reactorProjects )
             : releaseDescriptor.getReleaseVersions();
     }
 
-    protected Map<String,String> getNextVersionMap( ReleaseDescriptor releaseDescriptor
)
+    @SuppressWarnings("unchecked")
+	protected Map<String,String> getNextVersionMap( ReleaseDescriptor releaseDescriptor
)
     {
         return releaseDescriptor.getDevelopmentVersions();
     }

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java?rev=1230298&r1=1230297&r2=1230298&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
Wed Jan 11 22:39:25 2012
@@ -233,12 +233,14 @@ public class RewritePomsForReleasePhase
         return result;
     }
 
-    protected Map<String,String> getOriginalVersionMap( ReleaseDescriptor releaseDescriptor,
List<MavenProject> reactorProjects, boolean simulate )
+    @SuppressWarnings("unchecked")
+	protected Map<String,String> getOriginalVersionMap( ReleaseDescriptor releaseDescriptor,
List<MavenProject> reactorProjects, boolean simulate )
     {
         return releaseDescriptor.getOriginalVersions( reactorProjects );
     }
 
-    protected Map<String,String> getNextVersionMap( ReleaseDescriptor releaseDescriptor
)
+    @SuppressWarnings("unchecked")
+	protected Map<String,String> getNextVersionMap( ReleaseDescriptor releaseDescriptor
)
     {
         return releaseDescriptor.getReleaseVersions();
     }



Mime
View raw message