continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1392472 - /continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
Date Mon, 01 Oct 2012 17:46:12 GMT
Author: brett
Date: Mon Oct  1 17:46:11 2012
New Revision: 1392472

URL: http://svn.apache.org/viewvc?rev=1392472&view=rev
Log:
[CONTINUUM-2687] avoid exception if there are no existing entries

Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java?rev=1392472&r1=1392471&r2=1392472&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
Mon Oct  1 17:46:11 2012
@@ -83,13 +83,6 @@ public class ReleaseProjectAction
             DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
             preparedReleases = releaseManager.getPreparedReleases( project.getGroupId(),
project.getArtifactId() );
-
-            if ( !preparedReleases.isEmpty() )
-            {
-                // use last release as default choice
-                preparedReleaseId = new ArrayList<String>( preparedReleases.keySet()
).get(
-                    preparedReleases.size() - 1 );
-            }
         }
         else
         {
@@ -97,9 +90,17 @@ public class ReleaseProjectAction
 
             this.preparedReleases = releaseManager.getPreparedReleasesForProject( project.getGroupId(),
                                                                                   project.getArtifactId()
);
+        }
 
+        if ( !preparedReleases.isEmpty() )
+        {
+            // use last release as default choice
             preparedReleaseId = new ArrayList<String>( preparedReleases.keySet() ).get(
preparedReleases.size() - 1 );
         }
+        else
+        {
+            preparedReleaseId = null;
+        }
 
         projectName = project.getName();
 



Mime
View raw message