continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r765385 [2/3] - in /continuum/trunk: continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/ continuum-base/continuum-scm/src/main/java/org/apache/con...
Date Wed, 15 Apr 2009 21:56:49 GMT
Modified: continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java (original)
+++ continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java Wed Apr 15 21:56:46 2009
@@ -21,8 +21,8 @@
 /**
  * ContinuumRoleConstants:
  *
- * @author: Jesse McConnell <jmcconnell@apache.org>
- * @version: $Id$
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @version $Id$
  */
 public class ContinuumRoleConstants
 {
@@ -109,21 +109,21 @@
     public static final String USER_MANAGEMENT_USER_ROLE_OPERATION = "user-management-user-role";
 
     public static final String CONTINUUM_MANAGE_INSTALLATIONS = "continuum-manage-installations";
-    
+
     public static final String CONTINUUM_MANAGE_PROFILES = "continuum-manage-profiles";
-    
+
     public static final String CONTINUUM_MANAGE_BUILD_TEMPLATES = "continuum-manage-build-templates";
-    
+
     public static final String CONTINUUM_MANAGE_QUEUES = "continuum-manage-queues";
-    
+
     public static final String CONTINUUM_VIEW_QUEUES = "continuum-view-queues";
-    
+
     public static final String CONTINUUM_MANAGE_REPOSITORIES = "continuum-manage-repositories";
-    
+
     public static final String CONTINUUM_MANAGE_PURGING = "continuum-manage-purging";
 
     public static final String CONTINUUM_MANAGE_DISTRIBUTED_BUILDS = "continuum-manage-distributed-builds";
-    
+
     public static final String CONTINUUM_VIEW_RELEASE = "continuum-view-release";
 
     public static final String CONTINUUM_MANAGE_PARALLEL_BUILDS = "continuum-manage-parallel-builds";

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildDefinitionDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildDefinitionDaoImpl.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildDefinitionDaoImpl.java (original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildDefinitionDaoImpl.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,18 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.jdo.Extent;
+import javax.jdo.PersistenceManager;
+import javax.jdo.Query;
+import javax.jdo.Transaction;
+
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
@@ -30,17 +42,6 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Repository;
 
-import javax.annotation.Resource;
-import javax.jdo.Extent;
-import javax.jdo.PersistenceManager;
-import javax.jdo.Query;
-import javax.jdo.Transaction;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -51,7 +52,7 @@
     extends AbstractDao
     implements BuildDefinitionDao
 {
-    private Logger log = LoggerFactory.getLogger( BuildDefinitionDaoImpl.class );
+    private static final Logger log = LoggerFactory.getLogger( BuildDefinitionDaoImpl.class );
 
     /**
      * @plexus.requirement role="org.apache.continuum.dao.ProjectDao"

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java (original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java Wed Apr 15 21:56:46 2009
@@ -63,7 +63,7 @@
 
             query.setFilter( "this.schedule.id == scheduleId" );
 
-            List result = (List) query.execute( new Integer( scheduleId ) );
+            List result = (List) query.execute( scheduleId );
 
             return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
         }

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ProjectGroupDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ProjectGroupDaoImpl.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ProjectGroupDaoImpl.java (original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ProjectGroupDaoImpl.java Wed Apr 15 21:56:46 2009
@@ -223,7 +223,7 @@
 
             query.setFilter( "this.localRepository.id == repositoryId" );
 
-            List result = (List) query.execute( new Integer( repositoryId ) );
+            List result = (List) query.execute( repositoryId );
 
             return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
         }

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java (original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java Wed Apr 15 21:56:46 2009
@@ -19,16 +19,17 @@
  * under the License.
  */
 
-import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.springframework.stereotype.Repository;
+import java.util.Collections;
+import java.util.List;
 
 import javax.jdo.Extent;
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
 import javax.jdo.Transaction;
-import java.util.Collections;
-import java.util.List;
+
+import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.springframework.stereotype.Repository;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -63,7 +64,7 @@
 
             query.setFilter( "this.schedule.id == scheduleId" );
 
-            List result = (List) query.execute( new Integer( scheduleId ) );
+            List result = (List) query.execute( scheduleId );
 
             return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
         }
@@ -93,7 +94,7 @@
 
             query.setFilter( "this.repository.id == repositoryId" );
 
-            List result = (List) query.execute( new Integer( repositoryId ) );
+            List result = (List) query.execute( repositoryId );
 
             return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
         }

Modified: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java (original)
+++ continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.continuum.buildqueue.BuildQueueServiceException;
 import org.apache.continuum.configuration.BuildAgentConfiguration;
 import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
@@ -26,10 +30,6 @@
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Mock class for testing WagonContinuumNotifier's call to ConfigurationService.getBuildOutputFile()
  *
@@ -38,7 +38,7 @@
 public class ConfigurationServiceMock
     implements ConfigurationService
 {
-    private String basedir;
+    private final String basedir;
 
     public ConfigurationServiceMock()
     {
@@ -238,7 +238,7 @@
             throw new ConfigurationException(
                 "Could not make the release output directory: " + "'" + dir.getAbsolutePath() + "'." );
         }
-    
+
         return new File( dir, releaseName + ".log.txt" );
     }
 
@@ -255,15 +255,15 @@
     {
         return 1;
     }
-    
+
     public void setNumberOfBuildsInParallel( int num )
     {
-        
+
     }
 
     public void addBuildAgent( BuildAgentConfiguration buildAgent )
         throws ConfigurationException
-    {    
+    {
     }
 
     public List<BuildAgentConfiguration> getBuildAgents()
@@ -277,7 +277,7 @@
     }
 
     public void removeBuildAgent( BuildAgentConfiguration buildAgent )
-    {   
+    {
     }
 
     public void setDistributedBuildEnabled( boolean distributedBuildEnabled )
@@ -323,7 +323,7 @@
         return null;
     }
 
-    public BuildAgentConfiguration getBuildAgent(String url)
+    public BuildAgentConfiguration getBuildAgent( String url )
     {
         return null;
     }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java Wed Apr 15 21:56:46 2009
@@ -42,7 +42,7 @@
 public class ReleaseResultAction
     extends ContinuumConfirmAction
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( ReleaseResultAction.class );
 
     private int projectGroupId;
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java Wed Apr 15 21:56:46 2009
@@ -50,7 +50,7 @@
     extends ContinuumConfirmAction
     implements SecureAction
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( BuildAgentAction.class );
 
     /**
      * @plexus.requirement

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import com.opensymphony.xwork2.Preparable;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -43,86 +45,83 @@
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
 
-import com.opensymphony.xwork2.Preparable;
-
 /**
  * @author Maria Catherine Tan
  * @version $Id$
- * @since 25 jul 07
  * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="purgeConfiguration"
- *
+ * @since 25 jul 07
  */
 public class PurgeConfigurationAction
     extends ContinuumConfirmAction
     implements Preparable, SecureAction
 {
     private static final String PURGE_TYPE_REPOSITORY = "repository";
-    
+
     private static final String PURGE_TYPE_DIRECTORY = "directory";
-    
+
     private static final String PURGE_DIRECTORY_RELEASES = "releases";
-    
+
     private static final String PURGE_DIRECTORY_BUILDOUTPUT = "buildOutput";
-    
+
     private static final int DEFAULT_RETENTION_COUNT = 2;
-    
+
     private static final int DEFAULT_DAYS_OLDER = 100;
-    
+
     private String purgeType;
-    
+
     private String directoryType;
-    
+
     private String description;
-    
+
     private String message;
-    
+
     private boolean deleteAll;
-    
+
     private boolean deleteReleasedSnapshots;
-    
+
     private boolean enabled;
-    
+
     private boolean confirmed;
-    
+
     private boolean defaultPurgeConfiguration;
-    
+
     private int retentionCount;
-    
+
     private int daysOlder;
-    
+
     private int repositoryId;
-    
+
     private int scheduleId;
-    
+
     private int purgeConfigId;
-    
+
     private AbstractPurgeConfiguration purgeConfig;
-    
+
     private Map<Integer, String> repositories;
-    
+
     private Map<Integer, String> schedules;
-    
+
     private List<RepositoryPurgeConfiguration> repoPurgeConfigs;
-    
+
     private List<DirectoryPurgeConfiguration> dirPurgeConfigs;
-    
+
     private List<String> directoryTypes;
-    
+
     /**
      * @plexus.requirement
      */
     private PurgeConfigurationService purgeConfigService;
-    
+
     /**
      * @plexus.requirement
      */
     private RepositoryService repositoryService;
-    
+
     public void prepare()
         throws Exception
     {
         super.prepare();
-        
+
         // build schedules
         if ( schedules == null )
         {
@@ -132,35 +131,35 @@
 
             for ( Schedule schedule : allSchedules )
             {
-                schedules.put( new Integer( schedule.getId() ), schedule.getName() );
+                schedules.put( schedule.getId(), schedule.getName() );
             }
         }
-        
+
         // build repositories
         if ( repositories == null )
         {
             repositories = new HashMap<Integer, String>();
-            
+
             List<LocalRepository> allRepositories = repositoryService.getAllLocalRepositories();
-            
+
             for ( LocalRepository repository : allRepositories )
             {
-                repositories.put( new Integer( repository.getId() ), repository.getName() );
+                repositories.put( repository.getId(), repository.getName() );
             }
         }
-        
+
         directoryTypes = new ArrayList<String>();
         directoryTypes.add( PURGE_DIRECTORY_RELEASES );
         directoryTypes.add( PURGE_DIRECTORY_BUILDOUTPUT );
     }
-    
+
     public String input()
         throws Exception
     {
         if ( purgeConfigId != 0 )
         {
             purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );
-            
+
             if ( purgeConfig instanceof RepositoryPurgeConfiguration )
             {
                 RepositoryPurgeConfiguration repoPurge = (RepositoryPurgeConfiguration) purgeConfig;
@@ -173,12 +172,12 @@
                 this.enabled = repoPurge.isEnabled();
                 this.defaultPurgeConfiguration = repoPurge.isDefaultPurge();
                 this.description = repoPurge.getDescription();
-                
+
                 if ( repoPurge.getRepository() != null )
                 {
                     this.repositoryId = repoPurge.getRepository().getId();
                 }
-                
+
                 if ( repoPurge.getSchedule() != null )
                 {
                     this.scheduleId = repoPurge.getSchedule().getId();
@@ -187,7 +186,7 @@
             else if ( purgeConfig instanceof DirectoryPurgeConfiguration )
             {
                 DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
-                
+
                 this.purgeType = PURGE_TYPE_DIRECTORY;
                 this.daysOlder = dirPurge.getDaysOlder();
                 this.retentionCount = dirPurge.getRetentionCount();
@@ -196,7 +195,7 @@
                 this.enabled = dirPurge.isEnabled();
                 this.defaultPurgeConfiguration = dirPurge.isDefaultPurge();
                 this.description = dirPurge.getDescription();
-                
+
                 if ( dirPurge.getSchedule() != null )
                 {
                     this.scheduleId = dirPurge.getSchedule().getId();
@@ -208,26 +207,26 @@
             this.retentionCount = DEFAULT_RETENTION_COUNT;
             this.daysOlder = DEFAULT_DAYS_OLDER;
         }
-        
+
         return INPUT;
     }
-    
+
     public String list()
         throws Exception
     {
         String errorMessage = ServletActionContext.getRequest().getParameter( "errorMessage" );
-        
+
         if ( errorMessage != null )
         {
             addActionError( getText( errorMessage ) );
         }
-        
+
         repoPurgeConfigs = purgeConfigService.getAllRepositoryPurgeConfigurations();
         dirPurgeConfigs = purgeConfigService.getAllDirectoryPurgeConfigurations();
-        
+
         return SUCCESS;
     }
-    
+
     public String save()
         throws Exception
     {
@@ -241,63 +240,63 @@
             {
                 purgeConfig = new DirectoryPurgeConfiguration();
             }
-            
+
             purgeConfig = setupPurgeConfiguration( purgeConfig );
-            
+
             purgeConfig = purgeConfigService.addPurgeConfiguration( purgeConfig );
         }
         else
         {
             purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );
             purgeConfig = setupPurgeConfiguration( purgeConfig );
-            
+
             purgeConfigService.updatePurgeConfiguration( purgeConfig );
         }
-        
+
         if ( purgeConfig.isDefaultPurge() )
         {
             updateDefaultPurgeConfiguration();
         }
-        
+
         return SUCCESS;
     }
-    
+
     public String remove()
         throws Exception
     {
         if ( confirmed )
         {
-        	purgeConfigService.removePurgeConfiguration( purgeConfigId );
+            purgeConfigService.removePurgeConfiguration( purgeConfigId );
         }
         else
         {
             return CONFIRM;
         }
-        
+
         return SUCCESS;
     }
-    
+
     public String purge()
         throws Exception
     {
         ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
         TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();
-        
+
         if ( purgeConfigId > 0 )
         {
             purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );
-            
+
             if ( purgeConfig instanceof RepositoryPurgeConfiguration )
             {
                 RepositoryPurgeConfiguration repoPurge = (RepositoryPurgeConfiguration) purgeConfig;
-                
+
                 // check if repository is in use
                 if ( taskQueueManager.isRepositoryInUse( repoPurge.getRepository().getId() ) )
                 {
                     message = "repository.error.purge.in.use";
                     return ERROR;
                 }
-                
+
                 purgeManager.purgeRepository( repoPurge );
             }
             else
@@ -306,210 +305,210 @@
                 purgeManager.purgeDirectory( dirPurge );
             }
         }
-        
+
         return SUCCESS;
     }
-    
+
     public String getPurgeType()
     {
         return this.purgeType;
     }
-    
+
     public void setPurgeType( String purgeType )
     {
         this.purgeType = purgeType;
     }
-    
+
     public String getDirectoryType()
     {
         return this.directoryType;
     }
-    
+
     public void setDirectoryType( String directoryType )
     {
         this.directoryType = directoryType;
     }
-    
+
     public String getDescription()
     {
         return this.description;
     }
-    
+
     public void setDescription( String description )
     {
         this.description = description;
     }
-    
+
     public String getMessage()
     {
         return this.message;
     }
-    
+
     public void setMessage( String message )
     {
         this.message = message;
     }
-    
+
     public boolean isDeleteAll()
     {
         return this.deleteAll;
     }
-    
+
     public void setDeleteAll( boolean deleteAll )
     {
         this.deleteAll = deleteAll;
     }
-    
+
     public boolean isDeleteReleasedSnapshots()
     {
         return this.deleteReleasedSnapshots;
     }
-    
+
     public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
     {
         this.deleteReleasedSnapshots = deleteReleasedSnapshots;
     }
-    
+
     public boolean isEnabled()
     {
         return this.enabled;
     }
-    
+
     public void setEnabled( boolean enabled )
     {
         this.enabled = enabled;
     }
-    
+
     public boolean isConfirmed()
     {
         return this.confirmed;
     }
-    
+
     public void setConfirmed( boolean confirmed )
     {
         this.confirmed = confirmed;
     }
-    
+
     public boolean isDefaultPurgeConfiguration()
     {
         return this.defaultPurgeConfiguration;
     }
-    
+
     public void setDefaultPurgeConfiguration( boolean defaultPurgeConfiguration )
     {
         this.defaultPurgeConfiguration = defaultPurgeConfiguration;
     }
-    
+
     public int getRetentionCount()
     {
         return this.retentionCount;
     }
-    
+
     public void setRetentionCount( int retentionCount )
     {
         this.retentionCount = retentionCount;
     }
-    
+
     public int getDaysOlder()
     {
         return this.daysOlder;
     }
-    
+
     public void setDaysOlder( int daysOlder )
     {
         this.daysOlder = daysOlder;
     }
-    
+
     public int getRepositoryId()
     {
         return this.repositoryId;
     }
-    
+
     public void setRepositoryId( int repositoryId )
     {
         this.repositoryId = repositoryId;
     }
-    
+
     public int getScheduleId()
     {
         return this.scheduleId;
     }
-    
+
     public void setScheduleId( int scheduleId )
     {
         this.scheduleId = scheduleId;
     }
-    
+
     public int getPurgeConfigId()
     {
         return purgeConfigId;
     }
-    
+
     public void setPurgeConfigId( int purgeConfigId )
     {
         this.purgeConfigId = purgeConfigId;
     }
-    
+
     public AbstractPurgeConfiguration getPurgeConfig()
     {
         return this.purgeConfig;
     }
-    
+
     public void setPurgeConfig( AbstractPurgeConfiguration purgeConfig )
     {
         this.purgeConfig = purgeConfig;
     }
-    
+
     public Map<Integer, String> getRepositories()
     {
         return this.repositories;
     }
-    
+
     public void setRepositories( Map<Integer, String> repositories )
     {
         this.repositories = repositories;
     }
-    
+
     public Map<Integer, String> getSchedules()
     {
         return this.schedules;
     }
-    
+
     public void setSchedules( Map<Integer, String> schedules )
     {
         this.schedules = schedules;
     }
-    
+
     public List<RepositoryPurgeConfiguration> getRepoPurgeConfigs()
     {
         return this.repoPurgeConfigs;
     }
-    
+
     public void setRepoPurgeConfigs( List<RepositoryPurgeConfiguration> repoPurgeConfigs )
     {
         this.repoPurgeConfigs = repoPurgeConfigs;
     }
-    
+
     public List<DirectoryPurgeConfiguration> getDirPurgeConfigs()
     {
         return this.dirPurgeConfigs;
     }
-    
+
     public void setDirPurgeConfigs( List<DirectoryPurgeConfiguration> dirPurgeConfigs )
     {
         this.dirPurgeConfigs = dirPurgeConfigs;
     }
-    
+
     public List<String> getDirectoryTypes()
     {
         return this.directoryTypes;
     }
-    
+
     public void setDirectoryTypes( List<String> directoryTypes )
     {
         this.directoryTypes = directoryTypes;
     }
-    
+
     private AbstractPurgeConfiguration setupPurgeConfiguration( AbstractPurgeConfiguration purgeConfiguration )
         throws Exception
     {
@@ -522,7 +521,7 @@
             return buildDirPurgeConfiguration();
         }
     }
-    
+
     private RepositoryPurgeConfiguration buildRepoPurgeConfiguration()
         throws Exception
     {
@@ -535,22 +534,22 @@
         repoPurge.setDefaultPurge( this.defaultPurgeConfiguration );
         repoPurge.setDescription( this.description );
         repoPurge.setDefaultPurge( this.defaultPurgeConfiguration );
-        
+
         if ( repositoryId != 0 )
         {
             LocalRepository repository = repositoryService.getLocalRepository( repositoryId );
             repoPurge.setRepository( repository );
         }
-        
+
         if ( scheduleId > 0 )
         {
             Schedule schedule = getContinuum().getSchedule( scheduleId );
             repoPurge.setSchedule( schedule );
         }
-        
+
         return repoPurge;
     }
-    
+
     private DirectoryPurgeConfiguration buildDirPurgeConfiguration()
         throws Exception
     {
@@ -562,16 +561,16 @@
         dirPurge.setDescription( this.description );
         dirPurge.setDirectoryType( this.directoryType );
         dirPurge.setDefaultPurge( this.defaultPurgeConfiguration );
-        
+
         if ( scheduleId > 0 )
         {
             Schedule schedule = getContinuum().getSchedule( scheduleId );
             dirPurge.setSchedule( schedule );
         }
-        
+
         ConfigurationService configService = getContinuum().getConfiguration();
         String path = null;
-        
+
         if ( this.directoryType.equals( PURGE_DIRECTORY_RELEASES ) )
         {
             path = configService.getWorkingDirectory().getAbsolutePath();
@@ -580,19 +579,20 @@
         {
             path = configService.getBuildOutputDirectory().getAbsolutePath();
         }
-        
+
         dirPurge.setLocation( path );
-        
+
         return dirPurge;
     }
-    
+
     private void updateDefaultPurgeConfiguration()
         throws Exception
     {
         if ( purgeConfig instanceof RepositoryPurgeConfiguration )
         {
-            RepositoryPurgeConfiguration repoPurge = purgeConfigService.getDefaultPurgeConfigurationForRepository( repositoryId );
-            
+            RepositoryPurgeConfiguration repoPurge =
+                purgeConfigService.getDefaultPurgeConfigurationForRepository( repositoryId );
+
             if ( repoPurge != null && repoPurge.getId() != purgeConfig.getId() )
             {
                 repoPurge.setDefaultPurge( false );
@@ -601,8 +601,9 @@
         }
         else if ( purgeConfig instanceof DirectoryPurgeConfiguration )
         {
-            DirectoryPurgeConfiguration dirPurge = purgeConfigService.getDefaultPurgeConfigurationForDirectoryType( directoryType );
-            
+            DirectoryPurgeConfiguration dirPurge =
+                purgeConfigService.getDefaultPurgeConfigurationForDirectoryType( directoryType );
+
             if ( dirPurge != null && dirPurge.getId() != purgeConfig.getId() )
             {
                 dirPurge.setDefaultPurge( false );
@@ -610,7 +611,7 @@
             }
         }
     }
-    
+
     public SecureActionBundle getSecureActionBundle()
         throws SecureActionException
     {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java Wed Apr 15 21:56:46 2009
@@ -36,13 +36,13 @@
 
     }
 
-    @SuppressWarnings( "unchecked" )
+    @SuppressWarnings("unchecked")
     public static String generate( ProjectNotifier notifier )
     {
         Map configuration = notifier.getConfiguration();
         String recipent = "unknown";
-        if ( ( "mail".equals( notifier.getType() ) ) || ( "msn".equals( notifier.getType() ) )
-            || ( "jabber".equals( notifier.getType() ) ) )
+        if ( ( "mail".equals( notifier.getType() ) ) || ( "msn".equals( notifier.getType() ) ) ||
+            ( "jabber".equals( notifier.getType() ) ) )
         {
             if ( StringUtils.isNotEmpty( (String) configuration.get( AbstractContinuumNotifier.ADDRESS_FIELD ) ) )
             {
@@ -68,9 +68,9 @@
             recipent = (String) configuration.get( "host" );
             if ( configuration.get( "port" ) != null )
             {
-                recipent = recipent + ":" + (String) configuration.get( "port" );
+                recipent = recipent + ":" + configuration.get( "port" );
             }
-            recipent = recipent + ":" + (String) configuration.get( "channel" );
+            recipent = recipent + ":" + configuration.get( "channel" );
         }
         if ( "wagon".equals( notifier.getType() ) )
         {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java Wed Apr 15 21:56:46 2009
@@ -27,7 +27,6 @@
 import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
@@ -66,7 +65,7 @@
 
     private String scmPassword;
 
-    private Collection projectGroups;
+    private Collection<ProjectGroup> projectGroups;
 
     private String projectGroupName;
 
@@ -81,11 +80,11 @@
     private List<BuildDefinitionTemplate> buildDefinitionTemplates;
 
     private int buildDefinitionTemplateId;
-    
+
     private List<String> errorMessages = new ArrayList<String>();
 
     private HttpServletRequest httpServletRequest;
-    
+
     public String execute()
         throws ContinuumException, BuildDefinitionServiceException
     {
@@ -120,7 +119,7 @@
                     String encoding = this.httpServletRequest.getCharacterEncoding();
                     if ( StringUtils.isEmpty( encoding ) )
                     {
-                         encoding = System.getProperty( "file.encoding" );
+                        encoding = System.getProperty( "file.encoding" );
                     }
 
                     String encodedUsername = URLEncoder.encode( scmUsername, encoding );
@@ -128,8 +127,8 @@
 
                     StringBuffer urlBuffer = new StringBuffer();
                     urlBuffer.append( url.getProtocol() ).append( "://" );
-                    urlBuffer.append( encodedUsername ).append( ':' ).append( encodedPassword ).append( '@' )
-                        .append( url.getHost() );
+                    urlBuffer.append( encodedUsername ).append( ':' ).append( encodedPassword ).append( '@' ).append(
+                        url.getHost() );
                     if ( url.getPort() != -1 )
                     {
                         urlBuffer.append( ":" ).append( url.getPort() );
@@ -153,7 +152,7 @@
                 addActionError( getText( "add.project.unknown.error" ) );
                 return doDefault();
             }
-            
+
         }
         else
         {
@@ -194,7 +193,7 @@
             for ( String key : result.getErrors() )
             {
                 String cause = result.getErrorsWithCause().get( key );
-                String msg = getText( key, new String[] { cause } );
+                String msg = getText( key, new String[]{cause} );
 
                 // olamy : weird getText(key, String[]) must do that something like bla bla {0}
                 // here an ugly hack for CONTINUUM-1675
@@ -224,7 +223,7 @@
 
         if ( result.getProjectGroups() != null && !result.getProjectGroups().isEmpty() )
         {
-            this.setProjectGroupId( ( (ProjectGroup) result.getProjectGroups().get( 0 ) ).getId() );
+            this.setProjectGroupId( ( result.getProjectGroups().get( 0 ) ).getId() );
             return "projectGroupSummary";
         }
 
@@ -271,17 +270,16 @@
             addActionError( authzE.getMessage() );
             return REQUIRES_AUTHORIZATION;
         }
-        Collection allProjectGroups = getContinuum().getAllProjectGroups();
-        projectGroups = new ArrayList();
+        Collection<ProjectGroup> allProjectGroups = getContinuum().getAllProjectGroups();
+        projectGroups = new ArrayList<ProjectGroup>();
 
         ProjectGroup defaultGroup = new ProjectGroup();
         defaultGroup.setId( DEFINED_BY_POM_GROUP_ID );
         defaultGroup.setName( "Defined by POM" );
         projectGroups.add( defaultGroup );
 
-        for ( Iterator i = allProjectGroups.iterator(); i.hasNext(); )
+        for ( ProjectGroup pg : allProjectGroups )
         {
-            ProjectGroup pg = (ProjectGroup) i.next();
             if ( isAuthorizedToAddProjectToGroup( pg.getName() ) )
             {
                 projectGroups.add( pg );
@@ -295,7 +293,7 @@
 
     private void initializeProjectGroupName()
     {
-        if ( disableGroupSelection == true && selectedProjectGroup != DEFINED_BY_POM_GROUP_ID )
+        if ( disableGroupSelection && selectedProjectGroup != DEFINED_BY_POM_GROUP_ID )
         {
             try
             {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java Wed Apr 15 21:56:46 2009
@@ -71,7 +71,7 @@
         String resource = "";
 
         // TODO: remove this part once uploading of an m2 project with modules is supported ( CONTINUUM-1098 )
-        if ( ( checkProtocol == false ) || ( ( checkProtocol == true ) && ( pomUrl.startsWith( FILE_SCHEME ) ) ) )
+        if ( ( !checkProtocol ) || ( checkProtocol && pomUrl.startsWith( FILE_SCHEME ) ) )
         {
             MavenXpp3Reader m2pomReader = new MavenXpp3Reader();
 
@@ -156,19 +156,14 @@
         if ( result == null )
         {
             result = getContinuum().addMavenTwoProject( pomUrl, selectedProjectGroup, checkProtocol, scmUseCache,
-                                                        !this.isNonRecursiveProject(), this.getBuildDefinitionTemplateId() );
+                                                        !this.isNonRecursiveProject(),
+                                                        this.getBuildDefinitionTemplateId() );
         }
         
         triggerAuditEvent( getPrincipal(), AuditLogConstants.PROJECT, resource, AuditLogConstants.ADD_M2_PROJECT );
 
         return result;
     }
-    
-    public String doDefault()
-        throws BuildDefinitionServiceException
-    {
-        return super.doDefault();
-    }
 
     /**
      * @deprecated Use {@link #getPomFile()} instead
@@ -211,7 +206,7 @@
     {
         this.nonRecursiveProject = nonRecursiveProject;
     }
-    
+
     private String getSubString( String content, String tagStart, String tagEnd )
     {
         String subString = "";
@@ -222,5 +217,4 @@
         
         return subString;
     }
-
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java Wed Apr 15 21:56:46 2009
@@ -44,7 +44,7 @@
 public class AddProjectAction
     extends ContinuumActionSupport
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( AddProjectAction.class );
 
     private String projectName;
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java Wed Apr 15 21:56:46 2009
@@ -19,7 +19,8 @@
  * under the License.
  */
 
-import java.util.Iterator;
+import com.opensymphony.xwork2.Validateable;
+
 import java.util.List;
 
 import org.apache.continuum.model.repository.LocalRepository;
@@ -31,8 +32,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.opensymphony.xwork2.Validateable;
-
 /**
  * @author Henry Isidro <hisidro@exist.com>
  * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="addProjectGroup"
@@ -41,7 +40,7 @@
     extends ContinuumActionSupport
     implements Validateable
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( AddProjectGroupAction.class );
 
     private String name;
 
@@ -74,10 +73,8 @@
         }
         else if ( name != null && !name.equals( "" ) )
         {
-            Iterator iterator = getContinuum().getAllProjectGroups().iterator();
-            while ( iterator.hasNext() )
+            for ( ProjectGroup projectGroup : getContinuum().getAllProjectGroups() )
             {
-                ProjectGroup projectGroup = (ProjectGroup) iterator.next();
                 if ( name.equals( projectGroup.getName() ) )
                 {
                     addActionError( getText( "projectGroup.error.name.already.exists" ) );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java Wed Apr 15 21:56:46 2009
@@ -19,7 +19,12 @@
  * under the License.
  */
 
-import org.apache.continuum.web.util.AuditLogConstants;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
@@ -32,15 +37,9 @@
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.apache.maven.continuum.web.exception.ContinuumActionException;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 /**
  * BuildDefinitionAction:
  *
@@ -73,7 +72,7 @@
 
     private boolean buildFresh;
 
-    private Map schedules;
+    private Map<Integer, String> schedules;
 
     private List profiles;
 
@@ -106,15 +105,13 @@
 
         if ( schedules == null )
         {
-            schedules = new HashMap();
+            schedules = new HashMap<Integer, String>();
 
-            Collection allSchedules = getContinuum().getSchedules();
+            Collection<Schedule> allSchedules = getContinuum().getSchedules();
 
-            for ( Iterator i = allSchedules.iterator(); i.hasNext(); )
+            for ( Schedule schedule : allSchedules )
             {
-                Schedule schedule = (Schedule) i.next();
-
-                schedules.put( new Integer( schedule.getId() ), schedule.getName() );
+                schedules.put( schedule.getId(), schedule.getName() );
             }
         }
 
@@ -214,22 +211,23 @@
                 {
                     if ( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR.equals( executor ) )
                     {
-                        buildFile = ( (BuildDefinition) buildDefinitionService
-                            .getDefaultMavenTwoBuildDefinitionTemplate().getBuildDefinitions().get( 0 ) )
-                            .getBuildFile();
+                        buildFile =
+                            ( (BuildDefinition) buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getBuildDefinitions().get(
+                                0 ) ).getBuildFile();
                         buildDefinitionType = ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR;
                     }
                     else if ( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR.equals( executor ) )
                     {
-                        buildFile = ( (BuildDefinition) buildDefinitionService
-                            .getDefaultMavenOneBuildDefinitionTemplate().getBuildDefinitions().get( 0 ) )
-                            .getBuildFile();
+                        buildFile =
+                            ( (BuildDefinition) buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate().getBuildDefinitions().get(
+                                0 ) ).getBuildFile();
                         buildDefinitionType = ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR;
                     }
                     else if ( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR.equals( executor ) )
                     {
-                        buildFile = ( (BuildDefinition) buildDefinitionService.getDefaultAntBuildDefinitionTemplate()
-                            .getBuildDefinitions().get( 0 ) ).getBuildFile();
+                        buildFile =
+                            ( (BuildDefinition) buildDefinitionService.getDefaultAntBuildDefinitionTemplate().getBuildDefinitions().get(
+                                0 ) ).getBuildFile();
                         buildDefinitionType = ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR;
                     }
                     else
@@ -593,12 +591,12 @@
         this.buildFresh = buildFresh;
     }
 
-    public Map getSchedules()
+    public Map<Integer, String> getSchedules()
     {
         return schedules;
     }
 
-    public void setSchedules( final Map schedules )
+    public void setSchedules( final Map<Integer, String> schedules )
     {
         this.schedules = schedules;
     }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java Wed Apr 15 21:56:46 2009
@@ -85,11 +85,11 @@
             Project proj = getContinuum().getProject( projectId );
             triggerAuditEvent( getPrincipal(), AuditLogConstants.PROJECT, proj.getGroupId() + ":" + proj.getArtifactId(), AuditLogConstants.FORCE_BUILD );
 
-            if ( fromGroupPage == true )
+            if ( fromGroupPage )
             {
                 return "to_group_page";
             }
-            if ( fromProjectPage == true )
+            if ( fromProjectPage )
             {
                 return "to_project_page";
             }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java Wed Apr 15 21:56:46 2009
@@ -19,11 +19,17 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
 import org.apache.continuum.builder.utils.ContinuumBuildConstant;
+import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationException;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -35,12 +41,6 @@
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -89,7 +89,8 @@
         // check if there are surefire results to display
         project = getContinuum().getProject( getProjectId() );
 
-        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() && project.getState() == ContinuumProjectState.BUILDING )
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() &&
+            project.getState() == ContinuumProjectState.BUILDING )
         {
             Map<String, Object> map = distributedBuildManager.getBuildResult( project.getId() );
 
@@ -120,19 +121,13 @@
             File surefireReportsDirectory =
                 getContinuum().getConfiguration().getTestReportsDirectory( buildId, getProjectId() );
             File[] files = surefireReportsDirectory.listFiles();
-            if ( files == null )
-            {
-                hasSurefireResults = false;
-            }
-            else
-            {
-                hasSurefireResults = files.length > 0;
-            }
+            hasSurefireResults = files != null && files.length > 0;
             changeSet = getContinuum().getChangesSinceLastSuccess( getProjectId(), getBuildId() );
 
             buildOutput = getBuildOutputText();
 
-            state = StateGenerator.generate( buildResult.getState(), ServletActionContext.getRequest().getContextPath() );
+            state =
+                StateGenerator.generate( buildResult.getState(), ServletActionContext.getRequest().getContextPath() );
 
             this.setCanDelete( this.canRemoveBuildResult( buildResult ) );
         }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java Wed Apr 15 21:56:46 2009
@@ -25,6 +25,7 @@
 
 import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.codehaus.plexus.util.StringUtils;
@@ -39,11 +40,11 @@
 public class BuildResultsListAction
     extends AbstractBuildAction
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( BuildResultsListAction.class );
 
     private Project project;
 
-    private Collection buildResults;
+    private Collection<BuildResult> buildResults;
 
     private Collection<String> selectedBuildResults;
 
@@ -150,7 +151,7 @@
         this.projectId = projectId;
     }
 
-    public Collection getBuildResults()
+    public Collection<BuildResult> getBuildResults()
     {
         return buildResults;
     }
@@ -181,12 +182,12 @@
         return projectGroupName;
     }
 
-    public Collection getSelectedBuildResults()
+    public Collection<String> getSelectedBuildResults()
     {
         return selectedBuildResults;
     }
 
-    public void setSelectedBuildResults( Collection selectedBuildResults )
+    public void setSelectedBuildResults( Collection<String> selectedBuildResults )
     {
         this.selectedBuildResults = selectedBuildResults;
     }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java Wed Apr 15 21:56:46 2009
@@ -31,6 +31,7 @@
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.web.util.AuditLogConstants;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -45,188 +46,189 @@
  * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="cancelBuild"
  */
 public class CancelBuildAction
-	extends ContinuumActionSupport
+    extends ContinuumActionSupport
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( CancelBuildAction.class );
+
+    private int projectId;
+
+    private int projectGroupId;
+
+    private List<String> selectedProjects;
+
+    private String projectGroupName = "";
+
+    public String execute()
+        throws ContinuumException
+    {
+        try
+        {
+            checkBuildProjectInGroupAuthorization( getProjectGroupName() );
+
+            BuildsManager buildsManager = getContinuum().getBuildsManager();
+
+            buildsManager.cancelBuild( projectId );
+
+            Project proj = getContinuum().getProject( projectId );
+
+            triggerAuditEvent( getPrincipal(), AuditLogConstants.PROJECT, proj.getGroupId() + ":" + proj.getArtifactId(), AuditLogConstants.CANCEL_BUILD );
+        }
+        catch ( AuthorizationRequiredException e )
+        {
+            return REQUIRES_AUTHORIZATION;
+        }
+        catch ( BuildManagerException e )
+        {
+            throw new ContinuumException( "Error while canceling build", e );
+        }
+
+        return SUCCESS;
+    }
+
+    public String cancelBuilds()
+        throws ContinuumException
+    {
+        if ( getSelectedProjects() == null || getSelectedProjects().isEmpty() )
+        {
+            return SUCCESS;
+        }
+        int[] projectsId = new int[getSelectedProjects().size()];
+        for ( String selectedProjectId : getSelectedProjects() )
+        {
+            int projectId = Integer.parseInt( selectedProjectId );
+            projectsId = ArrayUtils.add( projectsId, projectId );
+        }
+
+        BuildsManager parallelBuildsManager = getContinuum().getBuildsManager();
+        parallelBuildsManager.removeProjectsFromBuildQueue( projectsId );
+
+        try
+        {
+            // now we must check if the current build is one of this
+            int index = ArrayUtils.indexOf( projectsId, getCurrentProjectIdBuilding() );
+            if ( index > 0 )
+            {
+                getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
+
+                int projId = projectsId[index];
+                getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
+                Project proj = getContinuum().getProject( projId );
+                triggerAuditEvent( getPrincipal(), AuditLogConstants.PROJECT, proj.getGroupId() + ":" + proj.getArtifactId(), AuditLogConstants.CANCEL_BUILD );
+            }
+
+        }
+        catch ( BuildManagerException e )
+        {
+            logger.error( e.getMessage() );
+            throw new ContinuumException( e.getMessage(), e );
+        }
+
+        return SUCCESS;
+    }
+
+    public String cancelGroupBuild()
+        throws ContinuumException
+    {
+        try
+        {
+            checkBuildProjectInGroupAuthorization( getContinuum().getProjectGroup( projectGroupId ).getName() );
+        }
+        catch ( AuthorizationRequiredException e )
+        {
+            return REQUIRES_AUTHORIZATION;
+        }
+
+        BuildsManager buildsManager = getContinuum().getBuildsManager();
+
+        List<ProjectScmRoot> scmRoots = getContinuum().getProjectScmRootByProjectGroup( projectGroupId );
+
+        if ( scmRoots != null )
+        {
+            for ( ProjectScmRoot scmRoot : scmRoots )
+            {
+                try
+                {
+                    buildsManager.removeProjectGroupFromPrepareBuildQueue( projectGroupId,
+                                                                           scmRoot.getScmRootAddress() );
+                    //taskQueueManager.removeFromPrepareBuildQueue( projectGroupId, scmRoot.getScmRootAddress() );
+                }
+                catch ( BuildManagerException e )
+                {
+                    throw new ContinuumException( "Unable to cancel group build", e );
+                }
+            }
+        }
+        Collection<Project> projects = getContinuum().getProjectsInGroup( projectGroupId );
+
+        List<String> projectIds = new ArrayList<String>();
+
+        for ( Project project : projects )
+        {
+            projectIds.add( Integer.toString( project.getId() ) );
+        }
+
+        setSelectedProjects( projectIds );
+
+        return cancelBuilds();
+    }
+
+    public void setProjectId( int projectId )
+    {
+        this.projectId = projectId;
+    }
+
+    public String getProjectGroupName()
+        throws ContinuumException
+    {
+        if ( StringUtils.isEmpty( projectGroupName ) )
+        {
+            projectGroupName = getContinuum().getProjectGroupByProjectId( projectId ).getName();
+        }
+
+        return projectGroupName;
+    }
+
+    public List<String> getSelectedProjects()
+    {
+        return selectedProjects;
+    }
+
+    public void setSelectedProjects( List<String> selectedProjects )
+    {
+        this.selectedProjects = selectedProjects;
+    }
+
+    public int getProjectGroupId()
+    {
+        return projectGroupId;
+    }
+
+    public void setProjectGroupId( int projectGroupId )
+    {
+        this.projectGroupId = projectGroupId;
+    }
+
+    /**
+     * @return -1 if not project currently building
+     * @throws ContinuumException
+     */
+    protected int getCurrentProjectIdBuilding()
+        throws ContinuumException, BuildManagerException
+    {
+        Map<String, Task> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
+        Set<String> keySet = currentBuilds.keySet();
 
-	private int projectId;
-	
-	private int projectGroupId;
-	
-	private List<String> selectedProjects;
-	
-	private String projectGroupName = "";
-	
-	public String execute()
-	    throws ContinuumException
-	{
-	    try
-	    {
-	        checkBuildProjectInGroupAuthorization( getProjectGroupName() );
-	
-	        BuildsManager buildsManager = getContinuum().getBuildsManager();
-	        
-	        buildsManager.cancelBuild( projectId );
-	        
-	        Project proj = getContinuum().getProject( projectId );
-
-          triggerAuditEvent( getPrincipal(), AuditLogConstants.PROJECT, proj.getGroupId() + ":" + proj.getArtifactId(), AuditLogConstants.CANCEL_BUILD );
-	    }
-	    catch ( AuthorizationRequiredException e )
-	    {
-	        return REQUIRES_AUTHORIZATION;
-	    }
-	    catch ( BuildManagerException e )
-	    {
-	        throw new ContinuumException( "Error while canceling build", e );
-	    }
-	
-	    return SUCCESS;
-	}
-	
-	public String cancelBuilds()
-	    throws ContinuumException
-	{
-	    if ( getSelectedProjects() == null || getSelectedProjects().isEmpty() )
-	    {
-	        return SUCCESS;
-	    }
-	    int[] projectsId = new int[getSelectedProjects().size()];
-	    for ( String selectedProjectId : getSelectedProjects() )
-	    {
-	        int projectId = Integer.parseInt( selectedProjectId );
-	        projectsId = ArrayUtils.add( projectsId, projectId );
-	    }
-	
-	    BuildsManager parallelBuildsManager = getContinuum().getBuildsManager();
-	    parallelBuildsManager.removeProjectsFromBuildQueue( projectsId );           
-	    
-	    try
-	    {
-	        // now we must check if the current build is one of this
-	        int index = ArrayUtils.indexOf( projectsId, getCurrentProjectIdBuilding() );
-	        if ( index > 0 )
-	        {
-	            getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
-	            
-	            int projId = projectsId[index];
-              getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
-              Project proj = getContinuum().getProject( projId );
-              triggerAuditEvent( getPrincipal(), AuditLogConstants.PROJECT, proj.getGroupId() + ":" + proj.getArtifactId(), AuditLogConstants.CANCEL_BUILD );
-	        }
-	        
-	    }
-	    catch ( BuildManagerException e )
-	    {
-	        logger.error( e.getMessage() );
-	        throw new ContinuumException( e.getMessage(), e );
-	    }
-	
-	    return SUCCESS;
-	}
-	
-	public String cancelGroupBuild()
-	    throws ContinuumException
-	{
-	    try
-	    {
-	        checkBuildProjectInGroupAuthorization( getContinuum().getProjectGroup( projectGroupId).getName() );
-	    }
-	    catch ( AuthorizationRequiredException e )
-	    {
-	        return REQUIRES_AUTHORIZATION;
-	    }
-	
-	    BuildsManager buildsManager = getContinuum().getBuildsManager();
-	
-	    List<ProjectScmRoot> scmRoots = getContinuum().getProjectScmRootByProjectGroup( projectGroupId );
-	    
-	    if ( scmRoots != null )
-	    {
-	        for ( ProjectScmRoot scmRoot : scmRoots )
-	        {
-	            try
-	            {
-	                buildsManager.removeProjectGroupFromPrepareBuildQueue( projectGroupId, scmRoot.getScmRootAddress() );
-	                //taskQueueManager.removeFromPrepareBuildQueue( projectGroupId, scmRoot.getScmRootAddress() );
-	            }
-	            catch ( BuildManagerException e )
-	            {
-	                throw new ContinuumException( "Unable to cancel group build", e );
-	            }
-	        }
-	    }
-	    Collection<Project> projects = getContinuum().getProjectsInGroup( projectGroupId );
-	
-	    List<String> projectIds = new ArrayList<String>();
-	    
-	    for ( Project project : projects )
-	    {
-	        projectIds.add( Integer.toString( project.getId() ) );
-	    }
-	
-	    setSelectedProjects( projectIds );
-	
-	    return cancelBuilds();
-	}
-	
-	public void setProjectId( int projectId )
-	{
-	    this.projectId = projectId;
-	}
-	
-	public String getProjectGroupName()
-	    throws ContinuumException
-	{
-	    if ( StringUtils.isEmpty( projectGroupName ) )
-	    {
-	        projectGroupName = getContinuum().getProjectGroupByProjectId( projectId ).getName();
-	    }
-	
-	    return projectGroupName;
-	}
-	
-	public List<String> getSelectedProjects()
-	{
-	    return selectedProjects;
-	}
-	
-	public void setSelectedProjects( List<String> selectedProjects )
-	{
-	    this.selectedProjects = selectedProjects;
-	}
-	
-	public int getProjectGroupId()
-	{
-	    return projectGroupId;
-	}
-	
-	public void setProjectGroupId( int projectGroupId )
-	{
-	    this.projectGroupId = projectGroupId;
-	}
-	
-	/**
-	 * @return -1 if not project currently building
-	 * @throws ContinuumException
-	 */
-	protected int getCurrentProjectIdBuilding()
-	    throws ContinuumException, BuildManagerException
-	{
-	    Map<String, Task> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
-	    Set<String> keySet = currentBuilds.keySet();
-	    
-	    for( String key : keySet )
-	    {
-	        Task task = currentBuilds.get( key );
-	        if ( task != null )
-	        {
-	            if ( task instanceof BuildProjectTask )
-	            {
-	                return ( (BuildProjectTask) task ).getProjectId();
-	            }
-	        }
-	    }        
-	    return -1;
-	}
+        for ( String key : keySet )
+        {
+            Task task = currentBuilds.get( key );
+            if ( task != null )
+            {
+                if ( task instanceof BuildProjectTask )
+                {
+                    return ( (BuildProjectTask) task ).getProjectId();
+                }
+            }
+        }
+        return -1;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java Wed Apr 15 21:56:46 2009
@@ -19,11 +19,12 @@
  * under the License.
  */
 
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.Preparable;
+
 import java.text.SimpleDateFormat;
 import java.util.ResourceBundle;
 
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.Preparable;
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.exception.AuthenticationRequiredException;
@@ -69,12 +70,12 @@
      */
     private Continuum continuum;
     
-    protected SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss aaa z");
-    
     private Logger logger = LoggerFactory.getLogger( "AuditLog" );
     
     private static final char DELIM = ' ';
 
+    protected final SimpleDateFormat dateFormatter = new SimpleDateFormat( "MMM dd, yyyy hh:mm:ss aaa z" );
+
     public void prepare()
         throws Exception
     {
@@ -468,9 +469,10 @@
     }
 
     /**
-     * Check if the current user is authorized to manage queues 
-     * 
-     * @throws AuthenticationRequiredException if the user isn't authenticated
+     * Check if the current user is authorized to manage queues
+     *
+     * @throws AuthenticationRequiredException
+     *                                        if the user isn't authenticated
      * @throws AuthorizationRequiredException if the user isn't authorized
      */
     protected void checkManageQueuesAuthorization()
@@ -480,16 +482,16 @@
         {
             throw new AuthenticationRequiredException( "Authentication required" );
         }
-        
+
         checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_QUEUES );
     }
-    
+
     protected void checkManageLocalRepositoriesAuthorization()
         throws AuthorizationRequiredException
-    {   
+    {
         checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_REPOSITORIES );
     }
-    
+
     /**
      * Get the security session
      *
@@ -544,7 +546,7 @@
 
         return true;
     }
-    
+
     protected ResourceBundle getResourceBundle()
     {
         return getTexts( "localization/Continuum" );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java Wed Apr 15 21:56:46 2009
@@ -39,7 +39,7 @@
 public class GroupSummaryAction
     extends ContinuumActionSupport
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( GroupSummaryAction.class );
 
     private String infoMessage;
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Wed Apr 15 21:56:46 2009
@@ -67,9 +67,9 @@
 public class ProjectGroupAction
     extends ContinuumConfirmAction
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( ProjectGroupAction.class );
 
-    private final static Map FILTER_CRITERIA = new HashMap();
+    private static final Map<String, String> FILTER_CRITERIA = new HashMap<String, String>();
 
     static
     {
@@ -103,20 +103,20 @@
 
     private Map projects = new HashMap();
 
-    private Map projectGroups = new HashMap();
+    private Map<Integer, String> projectGroups = new HashMap<Integer, String>();
 
     private boolean confirmed;
 
     private boolean projectInCOQueue = false;
 
-    private Collection projectList;
+    private Collection<Project> projectList;
 
-    private List projectGroupUsers;
+    private List<ProjectGroupUserBean> projectGroupUsers;
 
     private String filterProperty;
 
     private String filterKey;
-    
+
     //Default order is by username
     private String sorterProperty = "username";
 
@@ -170,10 +170,9 @@
 
                 if ( !buildDefinition.isDefaultForProject() )
                 {
-                    String key =
-                        StringUtils.isEmpty( buildDefinition.getDescription() ) ? buildDefinition.getGoals()
-                                        : buildDefinition.getDescription();
-                    buildDefinitions.put( key, Integer.valueOf( buildDefinition.getId() ) );
+                    String key = StringUtils.isEmpty( buildDefinition.getDescription() ) ? buildDefinition.getGoals()
+                        : buildDefinition.getDescription();
+                    buildDefinitions.put( key, buildDefinition.getId() );
                 }
             }
         }
@@ -194,11 +193,10 @@
                 // get the projects according to build order (first project in the group is the root project)
                 try
                 {
-                    Project rootProject =
-                        ( getContinuum().getProjectsInBuildOrder( getContinuum().getProjectsInGroupWithDependencies(
-                                                                                                                     projectGroupId ) ) ).get( 0 );
-                    if ( "maven2".equals( rootProject.getExecutorId() )
-                        || "maven-1".equals( rootProject.getExecutorId() ) )
+                    Project rootProject = ( getContinuum().getProjectsInBuildOrder(
+                        getContinuum().getProjectsInGroupWithDependencies( projectGroupId ) ) ).get( 0 );
+                    if ( "maven2".equals( rootProject.getExecutorId() ) ||
+                        "maven-1".equals( rootProject.getExecutorId() ) )
                     {
                         url = rootProject.getUrl();
                     }
@@ -339,11 +337,8 @@
 
         if ( projectList != null )
         {
-            Iterator proj = projectList.iterator();
-
-            while ( proj.hasNext() )
+            for ( Project p : projectList )
             {
-                Project p = (Project) proj.next();
                 try
                 {
                     if ( parallelBuildsManager.isInAnyCheckoutQueue( p.getId() ) )
@@ -355,17 +350,15 @@
                 {
                     throw new ContinuumException( e.getMessage(), e );
                 }
-                projects.put( p, new Integer( p.getProjectGroup().getId() ) );
+                projects.put( p, p.getProjectGroup().getId() );
             }
         }
 
-        Iterator proj_group = getContinuum().getAllProjectGroupsWithProjects().iterator();
-        while ( proj_group.hasNext() )
+        for ( ProjectGroup pg : getContinuum().getAllProjectGroupsWithProjects() )
         {
-            ProjectGroup pg = (ProjectGroup) proj_group.next();
             if ( isAuthorized( projectGroup.getName() ) )
             {
-                projectGroups.put( new Integer( pg.getId() ), pg.getName() );
+                projectGroups.put( pg.getId(), pg.getName() );
             }
         }
         repositories = getContinuum().getRepositoryService().getAllLocalRepositories();
@@ -522,7 +515,7 @@
                 }
             }
 
-            ProjectGroup newProjectGroup = getContinuum().getProjectGroupWithProjects( new Integer( id[0] ).intValue() );
+            ProjectGroup newProjectGroup = getContinuum().getProjectGroupWithProjects( new Integer( id[0] ) );
 
             if ( newProjectGroup.getId() != projectGroup.getId() && isAuthorized( newProjectGroup.getName() ) )
             {
@@ -605,12 +598,8 @@
 
         if ( projectList != null )
         {
-            Iterator proj = projectList.iterator();
-
-            while ( proj.hasNext() )
+            for ( Project p : projectList )
             {
-                Project p = (Project) proj.next();
-
                 if ( p.getState() != ContinuumProjectState.OK )
                 {
                     allBuildsOk = false;
@@ -657,22 +646,18 @@
         }
     }
 
-    private boolean isParentInProjectGroup( ProjectDependency parent, Collection projectsInGroup )
+    private boolean isParentInProjectGroup( ProjectDependency parent, Collection<Project> projectsInGroup )
         throws ContinuumException
     {
         boolean result = false;
 
-        Iterator projectsIterator = projectsInGroup.iterator();
-
-        while ( projectsIterator.hasNext() )
+        for ( Project project : projectsInGroup )
         {
-            Project project = (Project) projectsIterator.next();
-
             if ( parent != null )
             {
-                if ( ( project.getArtifactId().equals( parent.getArtifactId() ) )
-                    && ( project.getGroupId().equals( parent.getGroupId() ) )
-                    && ( project.getVersion().equals( parent.getVersion() ) ) )
+                if ( ( project.getArtifactId().equals( parent.getArtifactId() ) ) &&
+                    ( project.getGroupId().equals( parent.getGroupId() ) ) &&
+                    ( project.getVersion().equals( parent.getVersion() ) ) )
                 {
                     result = true;
                 }
@@ -721,7 +706,7 @@
             sortUsers( users, sorterProperty, ascending );
         }
 
-        projectGroupUsers = new ArrayList();
+        projectGroupUsers = new ArrayList<ProjectGroupUserBean>();
 
         if ( users == null )
         {
@@ -738,12 +723,10 @@
 
             try
             {
-                Collection effectiveRoles = rbac.getEffectivelyAssignedRoles( user.getUsername() );
+                Collection<Role> effectiveRoles = rbac.getEffectivelyAssignedRoles( user.getUsername() );
 
-                for ( Iterator j = effectiveRoles.iterator(); j.hasNext(); )
+                for ( Role role : effectiveRoles )
                 {
-                    Role role = (Role) j.next();
-
                     if ( role.getName().indexOf( projectGroup.getName() ) > -1 )
                     {
                         pgUser.setRoles( effectiveRoles );
@@ -763,7 +746,7 @@
         }
     }
 
-    private List<User> findUsers( List<User> users, String searchProperty, String searchKey)
+    private List<User> findUsers( List<User> users, String searchProperty, String searchKey )
     {
         List<User> userList = new ArrayList<User>();
         for ( User user : users )
@@ -805,7 +788,7 @@
 
         return userList;
     }
-    
+
     private void sortUsers( List<User> userList, final String sorterProperty, final boolean orderAscending )
     {
         Collections.sort( userList, new Comparator<User>()
@@ -902,7 +885,7 @@
         return projectGroups;
     }
 
-    public void setProjectGroups( Map projectGroups )
+    public void setProjectGroups( Map<Integer, String> projectGroups )
     {
         this.projectGroups = projectGroups;
     }
@@ -1094,7 +1077,7 @@
             return false;
         }
     }
-    
+
     public String getSorterProperty()
     {
         return sorterProperty;

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java Wed Apr 15 21:56:46 2009
@@ -37,7 +37,7 @@
 public class ProjectViewAction
     extends ContinuumActionSupport
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( ProjectViewAction.class );
 
     private Project project;
 
@@ -45,15 +45,10 @@
 
     private String lastBuildDateTime;
 
-    /**
-     * Target {@link ProjectGroup} to view.
-     */
-    private ProjectGroup projectGroup;
-
     public String execute()
         throws ContinuumException
     {
-        projectGroup = getProjectGroup();
+        ProjectGroup projectGroup = getProjectGroup();
 
         try
         {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java Wed Apr 15 21:56:46 2009
@@ -20,7 +20,6 @@
  */
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.continuum.web.util.AuditLogConstants;
@@ -41,7 +40,7 @@
 public class ProjectsListAction
     extends ContinuumActionSupport
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( ProjectsListAction.class );
 
     private List<String> selectedProjects;
 
@@ -146,9 +145,9 @@
         if ( selectedProjects != null && !selectedProjects.isEmpty() )
         {
             ArrayList<Project> projectsList = new ArrayList<Project>();
-            for ( Iterator i = selectedProjects.iterator(); i.hasNext(); )
+            for ( String pId : selectedProjects )
             {
-                int projectId = Integer.parseInt( (String) i.next() );
+                int projectId = Integer.parseInt( pId );
                 Project p = getContinuum().getProjectWithAllDetails( projectId );
                 projectsList.add( p );
             }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java Wed Apr 15 21:56:46 2009
@@ -44,7 +44,7 @@
     extends ContinuumConfirmAction
     implements Preparable
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( ScheduleAction.class );
 
     private int id;
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,13 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.maven.continuum.ContinuumException;
@@ -31,14 +38,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Used to render the list of projects in the project group page.
  *
@@ -49,13 +48,13 @@
 public class SummaryAction
     extends ContinuumActionSupport
 {
-    private Logger logger = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger logger = LoggerFactory.getLogger( SummaryAction.class );
 
     private int projectGroupId;
 
     private String projectGroupName;
 
-    private List summary;
+    private List<ProjectSummary> summary;
 
     private GroupSummary groupSummary = new GroupSummary();
 
@@ -77,14 +76,14 @@
             return REQUIRES_AUTHORIZATION;
         }
 
-        Collection projectsInGroup;
+        Collection<Project> projectsInGroup;
 
         //TODO: Create a summary jpox request so code will be more simple and performance will be better
         projectsInGroup = getContinuum().getProjectsInGroup( projectGroupId );
 
-        Map buildResults = getContinuum().getLatestBuildResults( projectGroupId );
+        Map<Integer, BuildResult> buildResults = getContinuum().getLatestBuildResults( projectGroupId );
 
-        Map buildResultsInSuccess = getContinuum().getBuildResultsInSuccess( projectGroupId );
+        Map<Integer, BuildResult> buildResultsInSuccess = getContinuum().getBuildResultsInSuccess( projectGroupId );
 
         summary = new ArrayList<ProjectSummary>();
 
@@ -93,10 +92,8 @@
         groupSummary.setNumSuccesses( 0 );
         groupSummary.setNumProjects( 0 );
 
-        for ( Iterator i = projectsInGroup.iterator(); i.hasNext(); )
+        for ( Project project : projectsInGroup )
         {
-            Project project = (Project) i.next();
-
             groupSummary.setNumProjects( groupSummary.getNumProjects() + 1 );
 
             ProjectSummary model = new ProjectSummary();
@@ -140,7 +137,7 @@
 
             if ( buildResultsInSuccess != null )
             {
-                BuildResult buildInSuccess = (BuildResult) buildResultsInSuccess.get( new Integer( project.getId() ) );
+                BuildResult buildInSuccess = buildResultsInSuccess.get( project.getId() );
 
                 if ( buildInSuccess != null )
                 {
@@ -150,7 +147,7 @@
 
             if ( buildResults != null )
             {
-                BuildResult latestBuild = (BuildResult) buildResults.get( new Integer( project.getId() ) );
+                BuildResult latestBuild = buildResults.get( project.getId() );
 
                 if ( latestBuild != null )
                 {
@@ -199,7 +196,7 @@
         }
     }
 
-    public List getProjects()
+    public List<ProjectSummary> getProjects()
     {
         return summary;
     }
@@ -214,7 +211,6 @@
         this.projectGroupId = projectGroupId;
     }
 
-
     public String getProjectGroupName()
     {
         return projectGroupName;



Mime
View raw message