continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r765385 [1/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
Author: evenisse
Date: Wed Apr 15 21:56:46 2009
New Revision: 765385

URL: http://svn.apache.org/viewvc?rev=765385&view=rev
Log:
merge -r 765339:765340 from 1.3.x branch

Modified:
    continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java
    continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java
    continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java
    continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/spring/ScmProviderFactoryBean.java
    continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedDefaultRepositoryContent.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedLegacyRepositoryContent.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/scanner/RepositoryScannerInstance.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FileTypes.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FilenameParser.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTask.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTaskExecutor.java
    continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/AbstractPurgeTest.java
    continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/executor/AbstractPurgeExecutorTest.java
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
    continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuite.java
    continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuiteGenerator.java
    continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildDefinitionDaoImpl.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ProjectGroupDaoImpl.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/EditPomAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/NotifierSummaryAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/appareance/DefaultAppareanceConfiguration.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/checks/security/RoleProfileEnvironmentCheck.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/WorkingCopyContentGenerator.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/validator/CronExpressionValidator.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/validator/InstallationValidator.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/buildresults/StateCell.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/commons/DateCell.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/jsp/ui/DateTag.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ReleasePrepareActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/TestAction.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ConfiguredBeanProcessorFactory.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumXmlRpcMetaDataHandler.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/PropertiesHandlerMapping.java

Modified: continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java (original)
+++ continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java Wed Apr 15 21:56:46 2009
@@ -30,43 +30,44 @@
 
 /**
  * Component that manages SCM interactions and checkouts within Continuum.
- * 
+ *
  * @version $Id$
  */
 public interface ContinuumScm
 {
     /**
      * Check out a working copy for a project.
-     * 
+     *
      * @param configuration the configuration for the working copy and SCM
      * @return the result of the check out
-     * @throws IOException if there is a problem writing to the working copy location
+     * @throws IOException                if there is a problem writing to the working copy location
      * @throws NoSuchScmProviderException if there is a problem with the configuration
-     * @throws ScmRepositoryException if there is a problem with the configuration
-     * @throws ScmException if there is a problem checking out
+     * @throws ScmRepositoryException     if there is a problem with the configuration
+     * @throws ScmException               if there is a problem checking out
      */
     CheckOutScmResult checkout( ContinuumScmConfiguration configuration )
         throws IOException, ScmRepositoryException, NoSuchScmProviderException, ScmException;
 
     /**
      * Update a working copy for a project.
-     * 
-     * @param configuration the configuration for the working copy and SCM
+     *
+     * @param config the configuration for the working copy and SCM
      * @return the result of the update
      * @throws NoSuchScmProviderException if there is a problem with the configuration
-     * @throws ScmRepositoryException if there is a problem with the configuration
-     * @throws ScmException if there is a problem updating
+     * @throws ScmRepositoryException     if there is a problem with the configuration
+     * @throws ScmException               if there is a problem updating
      */
     UpdateScmResult update( ContinuumScmConfiguration config )
         throws ScmRepositoryException, NoSuchScmProviderException, ScmException;
 
     /**
      * Get change log for a project
-     * @param config
+     *
+     * @param config the configuration for the working copy and SCM
      * @return the result of the change log
-     * @throws ScmRepositoryException if there is a problem with the configuration
+     * @throws ScmRepositoryException     if there is a problem with the configuration
      * @throws NoSuchScmProviderException if there is a problem with the configuration
-     * @throws ScmException if there is a problem getting the change log
+     * @throws ScmException               if there is a problem getting the change log
      */
     ChangeLogScmResult changeLog( ContinuumScmConfiguration config )
         throws ScmRepositoryException, NoSuchScmProviderException, ScmException;

Modified: continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java (original)
+++ continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java Wed Apr 15 21:56:46 2009
@@ -41,15 +41,16 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @todo consider folding some of this into Maven SCM itself
- * 
  * @version $Id$
+ * @todo consider folding some of this into Maven SCM itself
  */
 @Service("continuumScm")
 public class DefaultContinuumScm
     implements ContinuumScm
 {
-    /** The Maven SCM manager to use. */
+    /**
+     * The Maven SCM manager to use.
+     */
     @Resource
     private ScmManager scmManager;
 
@@ -109,8 +110,9 @@
         if ( !workingDirectory.exists() )
         {
             // TODO: maybe we could check it out - it seems we currently rely on Continuum figuring this out
-            throw new IllegalStateException( "The working directory for the project doesn't exist " + "("
-                + workingDirectory.getAbsolutePath() + ")." );
+            throw new IllegalStateException(
+                "The working directory for the project doesn't exist " + "(" + workingDirectory.getAbsolutePath() +
+                    ")." );
         }
 
         ScmRepository repository = getScmRepository( configuration );
@@ -159,10 +161,11 @@
 
     /**
      * Create a Maven SCM repository for obtaining the checkout from.
-     * 
-     * @param scmUrl the SCM URL to obtain the checkout from
-     * @param useCredentialsCache whether to allow the use of cached credentials for SVN
+     *
+     * @param configuration the configuration for the working copy and SCM
      * @return the repository created
+     * @throws NoSuchScmProviderException
+     * @throws ScmRepositoryException
      */
     private ScmRepository getScmRepository( ContinuumScmConfiguration configuration )
         throws ScmRepositoryException, NoSuchScmProviderException

Modified: continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java (original)
+++ continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java Wed Apr 15 21:56:46 2009
@@ -26,15 +26,15 @@
 
 /**
  * SLF4J logger for Maven SCM.
- * @todo move to maven-scm? 
- * 
+ *
  * @version $Id$
+ * @todo move to maven-scm?
  */
 @Service("scmLogger")
 public class Slf4jScmLogger
     implements ScmLogger
 {
-    private Logger logger = LoggerFactory.getLogger( Slf4jScmLogger.class );
+    private static final Logger logger = LoggerFactory.getLogger( Slf4jScmLogger.class );
 
     public void debug( String arg0 )
     {

Modified: continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/spring/ScmProviderFactoryBean.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/spring/ScmProviderFactoryBean.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/spring/ScmProviderFactoryBean.java (original)
+++ continuum/trunk/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/spring/ScmProviderFactoryBean.java Wed Apr 15 21:56:46 2009
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.maven.scm.provider.ScmProvider;
@@ -35,9 +34,9 @@
  * </p>
  * <p>
  * <code>&lt;bean id="scmProviders" class="org.apache.continuum.scm.manager.spring.ScmManagerFactoryBean"/>
- </code>
+ * </code>
  * </p>
- * 
+ *
  * @author Carlos Sanchez <carlos@apache.org>
  * @version $Id$
  */
@@ -45,15 +44,16 @@
     implements FactoryBean, ApplicationContextAware
 {
     private ApplicationContext applicationContext;
-   
+
     /**
-     * FIXME : change how we find scm implementations 
+     * FIXME : change how we find scm implementations
+     *
      * @see org.springframework.beans.factory.FactoryBean#getObject()
      */
     public Object getObject()
         throws Exception
     {
-        Map<String, ScmProvider> providers = new HashMap<String, ScmProvider>();
+        Map<String, ScmProvider> providers;
         /*
          olamy : comment the pure spring use because we have a duplicate between cvs java and cvs native
           
@@ -78,7 +78,8 @@
             }
             providers.put( provider.getScmType(), provider );
         }*/
-        providers =  PlexusToSpringUtils.lookupMap(PlexusToSpringUtils.buildSpringId( ScmProvider.class ), applicationContext );
+        providers =
+            PlexusToSpringUtils.lookupMap( PlexusToSpringUtils.buildSpringId( ScmProvider.class ), applicationContext );
         return providers;
     }
 

Modified: continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java (original)
+++ continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java Wed Apr 15 21:56:46 2009
@@ -21,8 +21,6 @@
 
 import java.util.Properties;
 
-import junit.framework.TestCase;
-
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
 import org.apache.maven.scm.provider.ScmProvider;
 import org.apache.maven.scm.provider.cvslib.cvsexe.CvsExeScmProvider;
@@ -32,26 +30,24 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
 
+import junit.framework.TestCase;
+
 /**
- * @todo replace with a spring integration test
- * 
  * @version $Id$
+ * @todo replace with a spring integration test
  */
 public class ScmManagerTest
     extends TestCase
 {
-    private ApplicationContext context;
+    private static final Logger log = LoggerFactory.getLogger( ScmManagerTest.class );
 
     private ScmManager manager;
-    
-    private Logger log = LoggerFactory.getLogger( getClass() );
 
     public void setUp()
     {
-        context =
-            new PlexusClassPathXmlApplicationContext( new String[] { "classpath*:META-INF/spring-context.xml",
-                "classpath*:META-INF/plexus/components.xml",
-                "classpath*:" + getClass().getName().replace( '.', '/' ) + ".xml" } );
+        ApplicationContext context = new PlexusClassPathXmlApplicationContext(
+            new String[]{"classpath*:META-INF/spring-context.xml", "classpath*:META-INF/plexus/components.xml",
+                "classpath*:" + getClass().getName().replace( '.', '/' ) + ".xml"} );
         manager = (ScmManager) context.getBean( "scmManager" );
     }
 
@@ -93,6 +89,6 @@
             System.setProperties( backupSysProps );
             System.setProperty( "maven.scm.provider.cvs.implementation", "cvs" );
         }
-        
+
     }
 }

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java Wed Apr 15 21:56:46 2009
@@ -115,7 +115,7 @@
     public DirectoryPurgeConfiguration addDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
         throws PurgeConfigurationServiceException
     {
-        DirectoryPurgeConfiguration dirPurgeConfig = null;
+        DirectoryPurgeConfiguration dirPurgeConfig;
 
         try
         {
@@ -132,7 +132,7 @@
     public RepositoryPurgeConfiguration addRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
         throws PurgeConfigurationServiceException
     {
-        RepositoryPurgeConfiguration repoPurgeConfig = null;
+        RepositoryPurgeConfiguration repoPurgeConfig;
 
         try
         {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java Wed Apr 15 21:56:46 2009
@@ -38,7 +38,7 @@
 public class DirectoryPurgeController
     implements PurgeController
 {
-    private Logger log = LoggerFactory.getLogger( DirectoryPurgeController.class );
+    private static final Logger log = LoggerFactory.getLogger( DirectoryPurgeController.class );
 
     private ContinuumPurgeExecutor purgeExecutor;
 

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java Wed Apr 15 21:56:46 2009
@@ -43,7 +43,7 @@
 public class RepositoryPurgeController
     implements PurgeController
 {
-    private Logger log = LoggerFactory.getLogger( RepositoryPurgeController.class );
+    private static final Logger log = LoggerFactory.getLogger( RepositoryPurgeController.class );
 
     private ContinuumPurgeExecutor purgeExecutor;
 

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.Set;
+
 import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
 import org.apache.continuum.purge.ContinuumPurgeConstants;
 import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
@@ -26,10 +30,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.Set;
-
 /**
  * Some codes were taken from Archiva.
  *
@@ -39,7 +39,7 @@
     implements ContinuumPurgeExecutor
 {
     private static final char DELIM = ' ';
-    
+
     private Logger logger = LoggerFactory.getLogger( "AuditLog" );
 
     public void purge( Set<ArtifactReference> references, RepositoryManagedContent repository )

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java Wed Apr 15 21:56:46 2009
@@ -19,23 +19,23 @@
  * under the License.
  */
 
-import org.apache.commons.io.filefilter.DirectoryFileFilter;
-import org.apache.continuum.purge.ContinuumPurgeConstants;
-import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
-import org.codehaus.plexus.util.FileUtils;
-
 import java.io.File;
 import java.io.FileFilter;
 import java.io.FilenameFilter;
 import java.io.IOException;
 
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.continuum.purge.ContinuumPurgeConstants;
+import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
+import org.codehaus.plexus.util.FileUtils;
+
 /**
  * @author Maria Catherine Tan
  */
 public class CleanAllPurgeExecutor
     extends AbstractContinuumPurgeExecutor
 {
-    private String purgeType;
+    private final String purgeType;
 
     public CleanAllPurgeExecutor( String purgeType )
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java Wed Apr 15 21:56:46 2009
@@ -19,13 +19,6 @@
  * under the License.
  */
 
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.comparator.LastModifiedFileComparator;
-import org.apache.commons.io.filefilter.DirectoryFileFilter;
-import org.apache.commons.lang.time.DateUtils;
-import org.apache.continuum.purge.ContinuumPurgeConstants;
-import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
-
 import java.io.File;
 import java.io.FileFilter;
 import java.io.FilenameFilter;
@@ -33,6 +26,13 @@
 import java.util.Arrays;
 import java.util.Calendar;
 
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.comparator.LastModifiedFileComparator;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.continuum.purge.ContinuumPurgeConstants;
+import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
+
 /**
  * @author Maria Catherine Tan
  */
@@ -40,11 +40,11 @@
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
-    private int daysOlder;
+    private final int daysOlder;
 
-    private int retentionCount;
+    private final int retentionCount;
 
-    private String directoryType;
+    private final String directoryType;
 
     public DaysOldDirectoryPurgeExecutor( int daysOlder, int retentionCount, String directoryType )
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java Wed Apr 15 21:56:46 2009
@@ -19,15 +19,6 @@
  * under the License.
  */
 
-import org.apache.commons.lang.time.DateUtils;
-import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
-import org.apache.maven.archiva.common.utils.VersionComparator;
-import org.apache.maven.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.VersionedReference;
-import org.apache.maven.archiva.repository.ContentNotFoundException;
-import org.apache.maven.archiva.repository.layout.LayoutException;
-
 import java.io.File;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -39,6 +30,15 @@
 import java.util.Set;
 import java.util.regex.Matcher;
 
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
+import org.apache.maven.archiva.common.utils.VersionComparator;
+import org.apache.maven.archiva.common.utils.VersionUtil;
+import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.repository.ContentNotFoundException;
+import org.apache.maven.archiva.repository.layout.LayoutException;
+
 /**
  * Codes were taken from  Archiva's DaysOldRepositoryPurge and made some few changes.
  *
@@ -48,13 +48,13 @@
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
-    private int daysOlder;
+    private final int daysOlder;
 
-    private int retentionCount;
+    private final int retentionCount;
 
-    private RepositoryManagedContent repository;
+    private final RepositoryManagedContent repository;
 
-    private SimpleDateFormat timestampParser;
+    private final SimpleDateFormat timestampParser;
 
     public DaysOldRepositoryPurgeExecutor( RepositoryManagedContent repository, int daysOlder, int retentionCount )
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,11 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.continuum.purge.ContinuumPurgeConstants;
 import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
 import org.apache.maven.archiva.common.utils.VersionComparator;
@@ -29,11 +34,6 @@
 import org.apache.maven.archiva.repository.ContentNotFoundException;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
 /**
  * Codes were taken from Archiva's CleanupReleasedSnapshotsRepositoryPurge and just made some few changes
  *
@@ -42,7 +42,7 @@
 public class ReleasedSnapshotsRepositoryPurgeExecutor
     extends AbstractContinuumPurgeExecutor
 {
-    private RepositoryManagedContent repository;
+    private final RepositoryManagedContent repository;
 
     public ReleasedSnapshotsRepositoryPurgeExecutor( RepositoryManagedContent repository )
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java Wed Apr 15 21:56:46 2009
@@ -19,18 +19,18 @@
  * under the License.
  */
 
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.comparator.LastModifiedFileComparator;
-import org.apache.commons.io.filefilter.DirectoryFileFilter;
-import org.apache.continuum.purge.ContinuumPurgeConstants;
-import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
-
 import java.io.File;
 import java.io.FileFilter;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.util.Arrays;
 
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.comparator.LastModifiedFileComparator;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.continuum.purge.ContinuumPurgeConstants;
+import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
+
 /**
  * @author Maria Catherine Tan
  */
@@ -38,9 +38,9 @@
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
-    private int retentionCount;
+    private final int retentionCount;
 
-    private String directoryType;
+    private final String directoryType;
 
     public RetentionCountDirectoryPurgeExecutor( int retentionCount, String directoryType )
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,12 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
 import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
 import org.apache.maven.archiva.common.utils.VersionComparator;
 import org.apache.maven.archiva.common.utils.VersionUtil;
@@ -27,12 +33,6 @@
 import org.apache.maven.archiva.repository.ContentNotFoundException;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
 /**
  * Codes were taken from Archiva's RetentionCountRepository Purge and made some few changes.
  *
@@ -42,9 +42,9 @@
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
-    private int retentionCount;
+    private final int retentionCount;
 
-    private RepositoryManagedContent repository;
+    private final RepositoryManagedContent repository;
 
     public RetentionCountRepositoryPurgeExecutor( RepositoryManagedContent repository, int retentionCount )
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedDefaultRepositoryContent.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedDefaultRepositoryContent.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedDefaultRepositoryContent.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedDefaultRepositoryContent.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,11 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.continuum.model.repository.LocalRepository;
@@ -34,11 +39,6 @@
 import org.apache.maven.archiva.repository.content.PathParser;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
 /**
  * Taken from Archiva's ManagedDefaultRepositoryContent and made some few changes.
  *
@@ -49,15 +49,15 @@
 public class ManagedDefaultRepositoryContent
     implements RepositoryManagedContent
 {
-    public static final String MAVEN_METADATA = "maven-metadata.xml";
+    private static final String MAVEN_METADATA = "maven-metadata.xml";
 
-    protected static final char PATH_SEPARATOR = '/';
+    private static final char PATH_SEPARATOR = '/';
 
-    protected static final char GROUP_SEPARATOR = '.';
+    private static final char GROUP_SEPARATOR = '.';
 
-    protected static final char ARTIFACT_SEPARATOR = '-';
+    private static final char ARTIFACT_SEPARATOR = '-';
 
-    private PathParser defaultPathParser = new DefaultPathParser();
+    private final PathParser defaultPathParser = new DefaultPathParser();
 
     /**
      * @plexus.requirement role-hint="file-types"
@@ -112,16 +112,15 @@
         Set<ArtifactReference> foundArtifacts = new HashSet<ArtifactReference>();
 
         // First gather up the versions found as artifacts in the managed repository.
-        File repoFiles[] = repoDir.listFiles();
-        for ( int i = 0; i < repoFiles.length; i++ )
+        for ( File repoFile : repoDir.listFiles() )
         {
-            if ( repoFiles[i].isDirectory() )
+            if ( repoFile.isDirectory() )
             {
                 // Skip it. it's a directory.
                 continue;
             }
 
-            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] );
+            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFile );
 
             if ( filetypes.matchesArtifactPattern( relativePath ) )
             {
@@ -155,7 +154,7 @@
      * information.
      *
      * @return the Set of available versions, based on the project reference.
-     * @throws LayoutException
+     * @throws ContentNotFoundException
      * @throws LayoutException
      */
     public Set<String> getVersions( ProjectReference reference )
@@ -188,17 +187,16 @@
         versionRef.setGroupId( reference.getGroupId() );
         versionRef.setArtifactId( reference.getArtifactId() );
 
-        File repoFiles[] = repoDir.listFiles();
-        for ( int i = 0; i < repoFiles.length; i++ )
+        for ( File repoFile : repoDir.listFiles() )
         {
-            if ( !repoFiles[i].isDirectory() )
+            if ( !repoFile.isDirectory() )
             {
                 // Skip it. not a directory.
                 continue;
             }
 
             // Test if dir has an artifact, which proves to us that it is a valid version directory.
-            String version = repoFiles[i].getName();
+            String version = repoFile.getName();
             versionRef.setVersion( version );
 
             if ( hasArtifact( versionRef ) )
@@ -239,16 +237,15 @@
         Set<String> foundVersions = new HashSet<String>();
 
         // First gather up the versions found as artifacts in the managed repository.
-        File repoFiles[] = repoDir.listFiles();
-        for ( int i = 0; i < repoFiles.length; i++ )
+        for ( File repoFile : repoDir.listFiles() )
         {
-            if ( repoFiles[i].isDirectory() )
+            if ( repoFile.isDirectory() )
             {
                 // Skip it. it's a directory.
                 continue;
             }
 
-            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] );
+            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFile );
 
             if ( filetypes.matchesDefaultExclusions( relativePath ) )
             {
@@ -337,12 +334,11 @@
     /**
      * Get the first Artifact found in the provided VersionedReference location.
      *
-     * @param managedRepository the repository to search within.
-     * @param reference         the reference to the versioned reference to search within
+     * @param reference the reference to the versioned reference to search within
      * @return the ArtifactReference to the first artifact located within the versioned reference. or null if
      *         no artifact was found within the versioned reference.
      * @throws IOException     if the versioned reference is invalid (example: doesn't exist, or isn't a directory)
-     * @throws LayoutException
+     * @throws LayoutException if the path cannot be converted to an artifact reference.
      */
     private ArtifactReference getFirstArtifact( VersionedReference reference )
         throws LayoutException, IOException
@@ -369,22 +365,19 @@
                 "Unable to gather the list of snapshot versions on a non-directory: " + repoDir.getAbsolutePath() );
         }
 
-        File repoFiles[] = repoDir.listFiles();
-        for ( int i = 0; i < repoFiles.length; i++ )
+        for ( File repoFile : repoDir.listFiles() )
         {
-            if ( repoFiles[i].isDirectory() )
+            if ( repoFile.isDirectory() )
             {
                 // Skip it. it's a directory.
                 continue;
             }
 
-            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] );
+            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFile );
 
             if ( filetypes.matchesArtifactPattern( relativePath ) )
             {
-                ArtifactReference artifact = toArtifactReference( relativePath );
-
-                return artifact;
+                return toArtifactReference( relativePath );
             }
         }
 

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedLegacyRepositoryContent.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedLegacyRepositoryContent.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedLegacyRepositoryContent.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/content/ManagedLegacyRepositoryContent.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,12 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.purge.repository.utils.FileTypes;
@@ -31,12 +37,6 @@
 import org.apache.maven.archiva.repository.content.PathParser;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 
-import java.io.File;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * Taken from Archiva's ManagedLegacyRepositoryContent and made some few changes
  *
@@ -338,8 +338,8 @@
             throw new IllegalArgumentException( "Artifact reference cannot be null" );
         }
 
-        return toPath( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(), reference
-            .getClassifier(), reference.getType() );
+        return toPath( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(),
+                       reference.getClassifier(), reference.getType() );
     }
 
     public void setRepository( LocalRepository repo )
@@ -380,16 +380,15 @@
 
     private void getRelatedArtifacts( File typeDir, ArtifactReference reference, Set<ArtifactReference> foundArtifacts )
     {
-        File repoFiles[] = typeDir.listFiles();
-        for ( int i = 0; i < repoFiles.length; i++ )
+        for ( File repoFile : typeDir.listFiles() )
         {
-            if ( repoFiles[i].isDirectory() )
+            if ( repoFile.isDirectory() )
             {
                 // Skip it. it's a directory.
                 continue;
             }
 
-            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] );
+            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFile );
 
             if ( filetypes.matchesArtifactPattern( relativePath ) )
             {
@@ -412,16 +411,15 @@
 
     private void getVersionedVersions( File typeDir, VersionedReference reference, Set<String> foundVersions )
     {
-        File repoFiles[] = typeDir.listFiles();
-        for ( int i = 0; i < repoFiles.length; i++ )
+        for ( File repoFile : typeDir.listFiles() )
         {
-            if ( repoFiles[i].isDirectory() )
+            if ( repoFile.isDirectory() )
             {
                 // Skip it. it's a directory.
                 continue;
             }
 
-            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] );
+            String relativePath = PathUtil.getRelative( repository.getLocation(), repoFile );
 
             if ( filetypes.matchesArtifactPattern( relativePath ) )
             {
@@ -447,7 +445,7 @@
         StringBuffer path = new StringBuffer();
 
         path.append( groupId ).append( PATH_SEPARATOR );
-        path.append( getDirectory( classifier, type ) ).append( PATH_SEPARATOR );
+        path.append( getDirectory( type ) ).append( PATH_SEPARATOR );
 
         if ( version != null )
         {
@@ -464,9 +462,9 @@
         return path.toString();
     }
 
-    private String getDirectory( String classifier, String type )
+    private String getDirectory( String type )
     {
-        String dirname = (String) typeToDirectoryMap.get( type );
+        String dirname = typeToDirectoryMap.get( type );
 
         if ( dirname != null )
         {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/scanner/RepositoryScannerInstance.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/scanner/RepositoryScannerInstance.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/scanner/RepositoryScannerInstance.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/scanner/RepositoryScannerInstance.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.io.File;
+
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.purge.controller.PurgeController;
 import org.apache.maven.archiva.common.utils.BaseFile;
@@ -26,19 +28,17 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-
 /**
  * Codes were taken from Archiva and made some few changes
  */
 public class RepositoryScannerInstance
     implements DirectoryWalkListener
 {
-    private Logger log = LoggerFactory.getLogger( RepositoryScannerInstance.class );
+    private static final Logger log = LoggerFactory.getLogger( RepositoryScannerInstance.class );
 
-    private LocalRepository repository;
+    private final LocalRepository repository;
 
-    private PurgeController purgeController;
+    private final PurgeController purgeController;
 
     public RepositoryScannerInstance( LocalRepository repository, PurgeController purgeController )
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FileTypes.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FileTypes.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FileTypes.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FileTypes.java Wed Apr 15 21:56:46 2009
@@ -19,11 +19,11 @@
  * under the License.
  */
 
-import org.codehaus.plexus.util.SelectorUtils;
-
 import java.util.Arrays;
 import java.util.List;
 
+import org.codehaus.plexus.util.SelectorUtils;
+
 /**
  * Codes were taken from Archiva and made some changes.
  */
@@ -33,9 +33,9 @@
 
     private List<String> ignoredFileTypePatterns;
 
-    public static final List<String> DEFAULT_EXCLUSIONS = Arrays.asList( "**/maven-metadata.xml",
-                                                                         "**/maven-metadata-*.xml", "**/*.sha1",
-                                                                         "**/*.asc", "**/*.md5", "**/*.pgp" );
+    public static final List<String> DEFAULT_EXCLUSIONS =
+        Arrays.asList( "**/maven-metadata.xml", "**/maven-metadata-*.xml", "**/*.sha1", "**/*.asc", "**/*.md5",
+                       "**/*.pgp" );
 
     public List<String> getIgnoredFileTypePatterns()
     {
@@ -62,7 +62,7 @@
             return false;
         }
 
-        for ( String pattern : (List<String>) artifactFileTypePatterns )
+        for ( String pattern : artifactFileTypePatterns )
         {
             if ( SelectorUtils.matchPath( pattern, relativePath, false ) )
             {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FilenameParser.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FilenameParser.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FilenameParser.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/repository/utils/FilenameParser.java Wed Apr 15 21:56:46 2009
@@ -19,11 +19,11 @@
  * under the License.
  */
 
-import org.apache.maven.archiva.common.utils.VersionUtil;
-
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.maven.archiva.common.utils.VersionUtil;
+
 /**
  * Codes were taken from Archiva's FilenameParser
  */
@@ -42,7 +42,7 @@
 
     private static final Pattern section = Pattern.compile( "([^-]*)" );
 
-    private Matcher matcher;
+    private final Matcher matcher;
 
     public FilenameParser( String filename )
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTask.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTask.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTask.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTask.java Wed Apr 15 21:56:46 2009
@@ -29,7 +29,7 @@
 {
     private int purgeConfigurationId;
 
-    private long timestamp;
+    private final long timestamp;
 
     private long maxExecutionTime;
 

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTaskExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTaskExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/task/PurgeTaskExecutor.java Wed Apr 15 21:56:46 2009
@@ -43,8 +43,6 @@
 public class PurgeTaskExecutor
     implements TaskExecutor, Contextualizable
 {
-    private PurgeController purgeController;
-
     /**
      * @plexus.requirement
      */
@@ -79,7 +77,8 @@
                         "Error while executing purge repository task: no repository set" );
                 }
 
-                purgeController = (PurgeController) container.lookup( PurgeController.ROLE, "purge-repository" );
+                PurgeController purgeController =
+                    (PurgeController) container.lookup( PurgeController.ROLE, "purge-repository" );
 
                 purgeController.initializeExecutors( repoPurge );
 
@@ -96,7 +95,8 @@
             {
                 DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
 
-                purgeController = (PurgeController) container.lookup( PurgeController.ROLE, "purge-directory" );
+                PurgeController purgeController =
+                    (PurgeController) container.lookup( PurgeController.ROLE, "purge-directory" );
 
                 purgeController.initializeExecutors( dirPurge );
 

Modified: continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/AbstractPurgeTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/AbstractPurgeTest.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/AbstractPurgeTest.java (original)
+++ continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/AbstractPurgeTest.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,14 @@
  * under the License.
  */
 
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+
 import org.apache.continuum.dao.DirectoryPurgeConfigurationDao;
 import org.apache.continuum.dao.LocalRepositoryDao;
 import org.apache.continuum.dao.RepositoryPurgeConfigurationDao;
@@ -30,13 +38,6 @@
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.jpox.SchemaTool;
 
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
-import java.io.File;
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
-
 /**
  * @author Maria Catherine Tan
  */
@@ -83,10 +84,12 @@
 
         localRepositoryDao = (LocalRepositoryDao) lookup( LocalRepositoryDao.class.getName() );
 
-        repositoryPurgeConfigurationDao = (RepositoryPurgeConfigurationDao) lookup( RepositoryPurgeConfigurationDao.class );
-        
-        directoryPurgeConfigurationDao = (DirectoryPurgeConfigurationDao) lookup( DirectoryPurgeConfigurationDao.class );
-        
+        repositoryPurgeConfigurationDao =
+            (RepositoryPurgeConfigurationDao) lookup( RepositoryPurgeConfigurationDao.class );
+
+        directoryPurgeConfigurationDao =
+            (DirectoryPurgeConfigurationDao) lookup( DirectoryPurgeConfigurationDao.class );
+
         if ( localRepositoryDao.getAllLocalRepositories().size() == 0 )
         {
             createDefaultRepository();
@@ -173,7 +176,6 @@
     }
 
     protected File getDefaultRepositoryLocation()
-        throws Exception
     {
         File repositoryLocation = getTestFile( TEST_DEFAULT_REPO_DIR );
 
@@ -191,7 +193,7 @@
 
         if ( !releasesDirectory.exists() )
         {
-            releasesDirectory.mkdir();
+            releasesDirectory.mkdirs();
         }
 
         return releasesDirectory;
@@ -203,7 +205,7 @@
 
         if ( !buildOutputDir.exists() )
         {
-            buildOutputDir.mkdir();
+            buildOutputDir.mkdirs();
         }
 
         return buildOutputDir;

Modified: continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/executor/AbstractPurgeExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/executor/AbstractPurgeExecutorTest.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/executor/AbstractPurgeExecutorTest.java (original)
+++ continuum/trunk/continuum-purge/src/test/java/org/apache/continuum/purge/executor/AbstractPurgeExecutorTest.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
 import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
@@ -26,10 +30,6 @@
 import org.apache.continuum.purge.task.PurgeTask;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @author Maria Catherine Tan
  */
@@ -42,7 +42,7 @@
 
     private static final String[] metadata_extensions = new String[]{".xml", ".xml.sha1", ".xml.md5"};
 
-    public static final String TEST_MAVEN_METADATA = "maven-metadata-central";
+    private static final String TEST_MAVEN_METADATA = "maven-metadata-central";
 
     private RepositoryPurgeConfiguration repoConfig;
 
@@ -187,14 +187,13 @@
 
         if ( recurse )
         {
-            File[] contents = dir.listFiles();
-            for ( int i = 0; i < contents.length; i++ )
+            for ( File content : dir.listFiles() )
             {
-                contents[i].setLastModified( lastModified );
+                content.setLastModified( lastModified );
 
-                if ( contents[i].list() != null && contents[i].list().length > 0 )
+                if ( content.list() != null && content.list().length > 0 )
                 {
-                    setLastModified( contents[i].getAbsolutePath(), lastModified, true );
+                    setLastModified( content.getAbsolutePath(), lastModified, true );
                 }
             }
         }
@@ -300,9 +299,9 @@
 
         String[] folders = new String[]{"1", "releases-4234729018", "", "releases-1234567809", "releases-1234567890"};
 
-        for ( int i = 0; i < folders.length; i++ )
+        for ( String folder : folders )
         {
-            File dir = new File( repoPath, folders[i] );
+            File dir = new File( repoPath, folder );
             dir.mkdir();
         }
     }
@@ -350,25 +349,25 @@
             versionDir.mkdirs();
 
             // create maven-metadata* files
-            for ( int i = 0; i < metadata_extensions.length; i++ )
+            for ( String metadata_extension : metadata_extensions )
             {
-                File metadata = new File( versionDir.getParentFile().getAbsolutePath(),
-                                          TEST_MAVEN_METADATA + metadata_extensions[i] );
+                File metadata =
+                    new File( versionDir.getParentFile().getAbsolutePath(), TEST_MAVEN_METADATA + metadata_extension );
                 metadata.createNewFile();
             }
         }
 
         for ( String version : versions )
         {
-            for ( int i = 0; i < jar_extensions.length; i++ )
+            for ( String jar_extension : jar_extensions )
             {
-                File file = new File( versionDir.getAbsolutePath(), artifactId + "-" + version + jar_extensions[i] );
+                File file = new File( versionDir.getAbsolutePath(), artifactId + "-" + version + jar_extension );
                 file.createNewFile();
             }
 
-            for ( int i = 0; i < pom_extensions.length; i++ )
+            for ( String pom_extension : pom_extensions )
             {
-                File file = new File( versionDir.getAbsolutePath(), artifactId + "-" + version + pom_extensions[i] );
+                File file = new File( versionDir.getAbsolutePath(), artifactId + "-" + version + pom_extension );
                 file.createNewFile();
             }
         }

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java (original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java Wed Apr 15 21:56:46 2009
@@ -29,9 +29,9 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
-import java.util.Map.Entry;
 
 import org.apache.maven.model.Scm;
 import org.apache.maven.shared.release.config.PropertiesReleaseDescriptorStore;
@@ -47,12 +47,12 @@
         throws ReleaseDescriptorStoreException
     {
         Properties properties = new Properties();
-    
+
         InputStream inStream = null;
         try
         {
             inStream = new FileInputStream( file );
-    
+
             properties.load( inStream );
         }
         catch ( FileNotFoundException e )
@@ -68,7 +68,7 @@
         {
             IOUtil.close( inStream );
         }
-    
+
         ContinuumReleaseDescriptor releaseDescriptor = new ContinuumReleaseDescriptor();
         releaseDescriptor.setCompletedPhase( properties.getProperty( "completedPhase" ) );
         releaseDescriptor.setScmSourceUrl( properties.getProperty( "scm.url" ) );
@@ -82,14 +82,14 @@
         releaseDescriptor.setAdditionalArguments( properties.getProperty( "exec.additionalArguments" ) );
         releaseDescriptor.setPomFileName( properties.getProperty( "exec.pomFileName" ) );
         releaseDescriptor.setPreparationGoals( properties.getProperty( "preparationGoals" ) );
-    
+
         loadResolvedDependencies( properties, releaseDescriptor );
-    
+
         // boolean properties are not written to the properties file because the value from the caller is always used
-    
-        for ( Iterator i = properties.keySet().iterator(); i.hasNext(); )
+
+        for ( Object o : properties.keySet() )
         {
-            String property = (String) i.next();
+            String property = (String) o;
             if ( property.startsWith( "project.rel." ) )
             {
                 releaseDescriptor.mapReleaseVersion( property.substring( "project.rel.".length() ),
@@ -106,7 +106,7 @@
                 if ( index > "project.scm.".length() )
                 {
                     String key = property.substring( "project.scm.".length(), index );
-    
+
                     if ( !releaseDescriptor.getOriginalScmInfo().containsKey( key ) )
                     {
                         if ( properties.getProperty( "project.scm." + key + ".empty" ) != null )
@@ -121,7 +121,7 @@
                                 properties.getProperty( "project.scm." + key + ".developerConnection" ) );
                             scm.setUrl( properties.getProperty( "project.scm." + key + ".url" ) );
                             scm.setTag( properties.getProperty( "project.scm." + key + ".tag" ) );
-    
+
                             releaseDescriptor.mapOriginalScmInfo( key, scm );
                         }
                     }
@@ -133,13 +133,13 @@
                                                    properties.getProperty( property ) );
             }
         }
-    
+
         if ( mergeDescriptor != null )
         {
             releaseDescriptor = (ContinuumReleaseDescriptor) ReleaseUtils.merge( releaseDescriptor, mergeDescriptor );
-            releaseDescriptor.setEnvironments( ( (ContinuumReleaseDescriptor)mergeDescriptor ).getEnvironments() );
+            releaseDescriptor.setEnvironments( ( (ContinuumReleaseDescriptor) mergeDescriptor ).getEnvironments() );
         }
-    
+
         return releaseDescriptor;
     }
 
@@ -190,24 +190,24 @@
         {
             properties.setProperty( "preparationGoals", config.getPreparationGoals() );
         }
-    
+
         // boolean properties are not written to the properties file because the value from the caller is always used
-    
-        for ( Iterator i = config.getReleaseVersions().entrySet().iterator(); i.hasNext(); )
+
+        for ( Object o : config.getReleaseVersions().entrySet() )
         {
-            Map.Entry entry = (Map.Entry) i.next();
+            Entry entry = (Entry) o;
             properties.setProperty( "project.rel." + entry.getKey(), (String) entry.getValue() );
         }
-    
-        for ( Iterator i = config.getDevelopmentVersions().entrySet().iterator(); i.hasNext(); )
+
+        for ( Object o : config.getDevelopmentVersions().entrySet() )
         {
-            Map.Entry entry = (Map.Entry) i.next();
+            Entry entry = (Entry) o;
             properties.setProperty( "project.dev." + entry.getKey(), (String) entry.getValue() );
         }
-    
-        for ( Iterator i = config.getOriginalScmInfo().entrySet().iterator(); i.hasNext(); )
+
+        for ( Object o : config.getOriginalScmInfo().entrySet() )
         {
-            Map.Entry entry = (Map.Entry) i.next();
+            Entry entry = (Entry) o;
             Scm scm = (Scm) entry.getValue();
             String prefix = "project.scm." + entry.getKey();
             if ( scm != null )
@@ -235,24 +235,24 @@
             }
         }
 
-        for ( Iterator i = config.getEnvironments().entrySet().iterator(); i.hasNext(); )
+        for ( Object o : config.getEnvironments().entrySet() )
         {
-            Map.Entry entry = (Map.Entry) i.next();
+            Entry entry = (Entry) o;
             properties.setProperty( "build.env." + entry.getKey(), (String) entry.getValue() );
         }
-    
+
         if ( ( config.getResolvedSnapshotDependencies() != null ) &&
             ( config.getResolvedSnapshotDependencies().size() > 0 ) )
         {
             processResolvedDependencies( properties, config.getResolvedSnapshotDependencies() );
         }
-    
+
         OutputStream outStream = null;
         //noinspection OverlyBroadCatchBlock
         try
         {
             outStream = new FileOutputStream( file );
-    
+
             properties.store( outStream, "release configuration" );
         }
         catch ( IOException e )
@@ -264,58 +264,52 @@
         {
             IOUtil.close( outStream );
         }
-    
+
     }
-    
+
     private void processResolvedDependencies( Properties prop, Map resolvedDependencies )
     {
         Set entries = resolvedDependencies.entrySet();
         Iterator iterator = entries.iterator();
         Entry currentEntry;
-    
+
         while ( iterator.hasNext() )
         {
             currentEntry = (Entry) iterator.next();
-    
+
             Map versionMap = (Map) currentEntry.getValue();
-    
+
             prop.setProperty( "dependency." + currentEntry.getKey() + ".release",
                               (String) versionMap.get( ReleaseDescriptor.RELEASE_KEY ) );
             prop.setProperty( "dependency." + currentEntry.getKey() + ".development",
                               (String) versionMap.get( ReleaseDescriptor.DEVELOPMENT_KEY ) );
         }
     }
-    
-    private static File getDefaultReleasePropertiesFile( ReleaseDescriptor mergeDescriptor )
-    {
-        return new File( mergeDescriptor.getWorkingDirectory(), "release.properties" );
-    }
-    
+
     private void loadResolvedDependencies( Properties prop, ReleaseDescriptor descriptor )
     {
-        Map resolvedDependencies = new HashMap();
-    
+        Map<String, Map<String, Object>> resolvedDependencies = new HashMap<String, Map<String, Object>>();
+
         Set entries = prop.entrySet();
         Iterator iterator = entries.iterator();
         String propertyName;
         Entry currentEntry;
-    
+
         while ( iterator.hasNext() )
         {
             currentEntry = (Entry) iterator.next();
             propertyName = (String) currentEntry.getKey();
-    
+
             if ( propertyName.startsWith( "dependency." ) )
             {
-                Map versionMap;
+                Map<String, Object> versionMap;
                 String artifactVersionlessKey;
                 int startIndex;
                 int endIndex;
                 String versionType;
-    
-                versionMap = new HashMap();
+
                 startIndex = propertyName.lastIndexOf( "dependency." );
-    
+
                 if ( propertyName.indexOf( ".development" ) != -1 )
                 {
                     endIndex = propertyName.indexOf( ".development" );
@@ -326,23 +320,23 @@
                     endIndex = propertyName.indexOf( ".release" );
                     versionType = ReleaseDescriptor.RELEASE_KEY;
                 }
-    
+
                 artifactVersionlessKey = propertyName.substring( startIndex, endIndex );
-    
+
                 if ( resolvedDependencies.containsKey( artifactVersionlessKey ) )
                 {
-                    versionMap = (Map) resolvedDependencies.get( artifactVersionlessKey );
+                    versionMap = resolvedDependencies.get( artifactVersionlessKey );
                 }
                 else
                 {
-                    versionMap = new HashMap();
+                    versionMap = new HashMap<String, Object>();
                     resolvedDependencies.put( artifactVersionlessKey, versionMap );
                 }
-    
+
                 versionMap.put( versionType, currentEntry.getValue() );
             }
         }
-    
+
         descriptor.setResolvedSnapshotDependencies( resolvedDependencies );
     }
 }

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java (original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,11 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
@@ -37,11 +42,6 @@
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 
-import java.io.File;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Properties;
-
 /**
  * @author Jason van Zyl
  * @author Edwin Punzalan
@@ -107,7 +107,8 @@
         String releaseId = project.getGroupId() + ":" + project.getArtifactId();
 
         ReleaseDescriptor descriptor =
-            getReleaseDescriptor( project, releaseProperties, relVersions, devVersions, environments, workingDirectory, executable );
+            getReleaseDescriptor( project, releaseProperties, relVersions, devVersions, environments, workingDirectory,
+                                  executable );
 
         getListeners().put( releaseId, listener );
 
@@ -225,7 +226,7 @@
                                                     String executable )
     {
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
-        
+
         //release properties from the project
         descriptor.setWorkingDirectory( workingDirectory );
         descriptor.setScmSourceUrl( project.getScmUrl() );

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java (original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java Wed Apr 15 21:56:46 2009
@@ -171,12 +171,12 @@
         return reactorProjects;
     }
 
-    private void addModules( List reactorProjects, MavenProject project )
+    private void addModules( List<MavenProject> reactorProjects, MavenProject project )
         throws ContinuumReleaseException
     {
-        for ( Iterator modules = project.getModules().iterator(); modules.hasNext(); )
+        for ( Object o : project.getModules() )
         {
-            String moduleDir = modules.next().toString();
+            String moduleDir = o.toString();
 
             File pomFile = new File( project.getBasedir(), moduleDir + "/pom.xml" );
             System.out.println( pomFile.getAbsolutePath() );

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java (original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java Wed Apr 15 21:56:46 2009
@@ -19,14 +19,14 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+
 import org.apache.maven.continuum.release.tasks.ReleaseProjectTask;
 import org.apache.maven.shared.release.ReleaseExecutionException;
 import org.apache.maven.shared.release.ReleaseFailureException;
 import org.apache.maven.shared.release.ReleaseManagerListener;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 
-import java.util.ArrayList;
-
 /**
  * @author Edwin Punzalan
  * @version $Id$
@@ -34,8 +34,6 @@
 public class RollbackReleaseTaskExecutor
     extends AbstractReleaseTaskExecutor
 {
-    private static final int ERROR = 99;
-
     protected void execute( ReleaseProjectTask releaseTask )
         throws TaskExecutionException
     {
@@ -46,17 +44,17 @@
         }
         catch ( ReleaseExecutionException e )
         {
-            updateListener( releaseTask.getListener(), e.getMessage(), ERROR );
+            updateListener( releaseTask.getListener(), e.getMessage() );
             throw new TaskExecutionException( "Failed to rollback release", e );
         }
         catch ( ReleaseFailureException e )
         {
-            updateListener( releaseTask.getListener(), e.getMessage(), ERROR );
+            updateListener( releaseTask.getListener(), e.getMessage() );
             throw new TaskExecutionException( "Failed to rollback release", e );
         }
     }
 
-    private void updateListener( ReleaseManagerListener listener, String name, int state )
+    private void updateListener( ReleaseManagerListener listener, String name )
     {
         listener.error( name );
     }

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java (original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java Wed Apr 15 21:56:46 2009
@@ -19,6 +19,11 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
@@ -48,12 +53,6 @@
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * Generate the reactor projects
  *
@@ -113,15 +112,15 @@
     private List getReactorProjects( ReleaseDescriptor descriptor )
         throws ContinuumReleaseException
     {
-        List reactorProjects = new ArrayList();
+        List<MavenProject> reactorProjects = new ArrayList<MavenProject>();
 
         MavenProject project;
         try
         {
             ArtifactRepository repository = getLocalRepository( descriptor.getAdditionalArguments() );
 
-            project = projectBuilder.buildWithDependencies( getProjectDescriptorFile( descriptor ),
-                                                            repository, getProfileManager( getSettings() ) );
+            project = projectBuilder.buildWithDependencies( getProjectDescriptorFile( descriptor ), repository,
+                                                            getProfileManager( getSettings() ) );
 
             reactorProjects.add( project );
 
@@ -156,20 +155,19 @@
         return reactorProjects;
     }
 
-    private void addModules( List reactorProjects, MavenProject project, ArtifactRepository repository )
+    private void addModules( List<MavenProject> reactorProjects, MavenProject project, ArtifactRepository repository )
         throws ContinuumReleaseException
     {
-        for ( Iterator modules = project.getModules().iterator(); modules.hasNext(); )
+        for ( Object o : project.getModules() )
         {
-            String moduleDir = modules.next().toString();
+            String moduleDir = o.toString();
 
             File pomFile = new File( project.getBasedir(), moduleDir + "/pom.xml" );
 
             try
             {
-                MavenProject reactorProject = projectBuilder.buildWithDependencies( pomFile, repository,
-                                                                                    getProfileManager(
-                                                                                        getSettings() ) );
+                MavenProject reactorProject =
+                    projectBuilder.buildWithDependencies( pomFile, repository, getProfileManager( getSettings() ) );
 
                 reactorProjects.add( reactorProject );
 
@@ -211,13 +209,14 @@
         if ( arguments != null )
         {
             String[] args = arguments.split( " " );
+
             boolean shouldContinue = false;
-            
-            for ( int i = 0; i < args.length; i++ )
+ 
+            for ( String arg : args )
             {
-                if ( args[i].contains( "-Dmaven.repo.local=" ) )
+                if ( arg.contains( "-Dmaven.repo.local=" ) )
                 {
-                    localRepository = args[i].substring( args[i].indexOf( "=" ) + 1 );
+                    localRepository = arg.substring( arg.indexOf( "=" ) + 1 );
 
                     if ( !localRepository.endsWith( "\"" ) )
                     {
@@ -231,9 +230,9 @@
                 }
                 else if ( shouldContinue )
                 {
-                    localRepository += " " + args[i];
+                    localRepository += " " + arg;
 
-                    if ( args[i].endsWith( "\"" ) )
+                    if ( arg.endsWith( "\"" ) )
                     {
                         break;
                     }

Modified: continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuite.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuite.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuite.java (original)
+++ continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuite.java Wed Apr 15 21:56:46 2009
@@ -1,3 +1,4 @@
+package org.apache.maven.continuum.reports.surefire;
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,15 +17,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.continuum.reports.surefire;
 
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
 import java.io.File;
 import java.io.IOException;
 import java.text.NumberFormat;
@@ -33,6 +26,14 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
  * @version $Id$
@@ -57,7 +58,7 @@
 
     private float timeElapsed;
 
-    private NumberFormat numberFormat = NumberFormat.getInstance();
+    private final NumberFormat numberFormat = NumberFormat.getInstance();
 
     /**
      * @noinspection StringBufferField
@@ -139,7 +140,7 @@
 
                 String timeAsString = attributes.getValue( "time" );
 
-                Number time = new Integer( 0 );
+                Number time = 0;
 
                 if ( timeAsString != null )
                 {

Modified: continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuiteGenerator.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuiteGenerator.java?rev=765385&r1=765384&r2=765385&view=diff
==============================================================================
--- continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuiteGenerator.java (original)
+++ continuum/trunk/continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuiteGenerator.java Wed Apr 15 21:56:46 2009
@@ -23,45 +23,50 @@
 
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
- * @since 12 nov. 07
  * @version $Id$
+ * @since 12 nov. 07
  */
 public interface ReportTestSuiteGenerator
 {
 
     /**
      * @param directory directory containing surefire tests files
-     * @param includes file types to include
-     * @param excludes file types to exclude
+     * @param includes  file types to include
+     * @param excludes  file types to exclude
      * @return List of {@link ReportTestSuite}
      * @throws ReportTestSuiteGeneratorException
+     *
      */
     List<ReportTestSuite> generateReports( File directory, List<String> includes, List<String> excludes )
         throws ReportTestSuiteGeneratorException;
-    
+
     /**
      * Use generateReports with default includes *.xml and default excludes *.txt
+     *
      * @param directory directory containing surefire tests files
      * @return List of {@link ReportTestSuite}
      * @throws ReportTestSuiteGeneratorException
+     *
      */
     List<ReportTestSuite> generateReports( File directory )
-        throws ReportTestSuiteGeneratorException;  
-    
+        throws ReportTestSuiteGeneratorException;
+
     /**
      * @param buildId
      * @param projectId
      * @return List of {@link ReportTestSuite}
      * @throws ReportTestSuiteGeneratorException
+     *
      */
     List<ReportTestSuite> generateReports( int buildId, int projectId )
         throws ReportTestSuiteGeneratorException;
-    
+
     /**
      * @param buildId
      * @param projectId
-     * @return List of {@link TestResult}
+     * @return List of {@link ReportTestResult}
      * @throws ReportTestSuiteGeneratorException
+     *
      */
     ReportTestResult generateReportTestResult( int buildId, int projectId )
         throws ReportTestSuiteGeneratorException;



Mime
View raw message