continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r751864 [1/4] - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/dao/ continuum-api/src/main/java/org/apache/continuum/taskqueue/ continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/ continuum-api/src/mai...
Date Mon, 09 Mar 2009 22:02:36 GMT
Author: evenisse
Date: Mon Mar  9 22:02:34 2009
New Revision: 751864

URL: http://svn.apache.org/viewvc?rev=751864&view=rev
Log:
more java5 + license + format + some potential NPE

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManagerException.java
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/shell/DefaultShellCommandHelper.java
    continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
    continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckWorkingDirectoryAction.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelper.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelperException.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/DefaultBuildAgentMavenOneMetadataHelper.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
    continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
    continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java
    continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/installation/DefaultInstallationService.java
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/installation/DefaultInstallationServiceTest.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/utils/ContinuumUtilsTest.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/manager/DefaultBuildExecutorManager.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.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/DaoUtilsImpl.java

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java Mon Mar  9 22:02:34 2009
@@ -21,7 +21,6 @@
 
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
-import javax.jdo.PersistenceManagerFactory;
 import java.util.Map;
 
 /**

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java Mon Mar  9 22:02:34 2009
@@ -1,5 +1,24 @@
 package org.apache.continuum.taskqueue;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.util.Map;
 
 import org.codehaus.plexus.taskqueue.Task;
@@ -19,9 +38,8 @@
 
     private int projectScmRootId;
 
-    public PrepareBuildProjectsTask( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger,
-                                     int projectGroupId, String projectGroupName, String scmRootAddress,
-                                     int projectScmRootId )
+    public PrepareBuildProjectsTask( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger, int projectGroupId,
+                                     String projectGroupName, String scmRootAddress, int projectScmRootId )
     {
         this.projectsBuildDefinitionsMap = projectsBuildDefinitionsMap;
         this.trigger = trigger;
@@ -30,18 +48,18 @@
         this.scmRootAddress = scmRootAddress;
         this.projectScmRootId = projectScmRootId;
     }
-    
+
     public long getMaxExecutionTime()
     {
         // TODO Auto-generated method stub
         return 0;
     }
-    
+
     public Map<Integer, Integer> getProjectsBuildDefinitionsMap()
     {
         return projectsBuildDefinitionsMap;
     }
-    
+
     public void setProjectsBuildDefinitionsMap( Map<Integer, Integer> projectsBuildDefinitionsMap )
     {
         this.projectsBuildDefinitionsMap = projectsBuildDefinitionsMap;
@@ -56,7 +74,7 @@
     {
         this.trigger = trigger;
     }
-    
+
     public int getHashCode()
     {
         return this.hashCode();

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManagerException.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManagerException.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManagerException.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManagerException.java Mon Mar  9 22:02:34 2009
@@ -1,5 +1,24 @@
 package org.apache.continuum.taskqueue.manager;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 public class TaskQueueManagerException
     extends Exception
 {

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/shell/DefaultShellCommandHelper.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/shell/DefaultShellCommandHelper.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/shell/DefaultShellCommandHelper.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/shell/DefaultShellCommandHelper.java Mon Mar  9 22:02:34 2009
@@ -69,7 +69,7 @@
 
     /**
      * Make the command line
-     * 
+     *
      * @param workingDirectory
      * @param executable
      * @param arguments
@@ -90,9 +90,8 @@
 
         if ( environments != null && !environments.isEmpty() )
         {
-            for ( Iterator<String> iterator = environments.keySet().iterator(); iterator.hasNext(); )
+            for ( String key : environments.keySet() )
             {
-                String key = iterator.next();
                 String value = environments.get( key );
                 cl.addEnvironment( key, value );
             }
@@ -106,10 +105,8 @@
 
         if ( arguments != null )
         {
-            for ( int i = 0; i < arguments.length; i++ )
+            for ( String argument : arguments )
             {
-                String argument = arguments[i];
-
                 cl.createArgument().setValue( argument );
             }
         }
@@ -161,8 +158,8 @@
         CommandLineUtils.killProcess( idCommand );
     }
 
-    public void executeGoals( File workingDirectory, String executable, String goals, boolean interactive, String arguments,
-                              ReleaseResult relResult, Map<String, String> environments )
+    public void executeGoals( File workingDirectory, String executable, String goals, boolean interactive,
+                              String arguments, ReleaseResult relResult, Map<String, String> environments )
         throws Exception
     {
         Commandline cl = new Commandline();
@@ -174,8 +171,8 @@
         executeGoals( workingDirectory, executable, goals, interactive, argument.getParts(), relResult, environments );
     }
 
-    public void executeGoals( File workingDirectory, String executable, String goals, boolean interactive, String[] arguments,
-                              ReleaseResult relResult, Map<String, String> environments )
+    public void executeGoals( File workingDirectory, String executable, String goals, boolean interactive,
+                              String[] arguments, ReleaseResult relResult, Map<String, String> environments )
         throws Exception
     {
         if ( executable == null )
@@ -190,10 +187,10 @@
             // accept both space and comma, so the old way still work
             String[] tokens = StringUtils.split( goals, ", " );
 
-            for ( int i = 0; i < tokens.length; ++i )
-    		{
-                cl.createArgument().setValue( tokens[i] );
-    		}
+            for ( String token : tokens )
+            {
+                cl.createArgument().setValue( token );
+            }
         }
 
         cl.createArgument().setValue( "--no-plugin-updates" );
@@ -209,16 +206,16 @@
 
         try
         {
-    		relResult.appendInfo( "Executing: " + cl.toString() );
-    		log.info( "Executing: " + cl.toString() );
+            relResult.appendInfo( "Executing: " + cl.toString() );
+            log.info( "Executing: " + cl.toString() );
 
-    		int result = CommandLineUtils.executeCommandLine( cl, stdOut, stdErr );
+            int result = CommandLineUtils.executeCommandLine( cl, stdOut, stdErr );
 
-    		if ( result != 0 )
-    		{
-    		    throw new MavenExecutorException( "Maven execution failed, exit code: \'" + result + "\'", result,
-    		                                      stdOut.toString(), stdErr.toString() );
-    		}
+            if ( result != 0 )
+            {
+                throw new MavenExecutorException( "Maven execution failed, exit code: \'" + result + "\'", result,
+                                                  stdOut.toString(), stdErr.toString() );
+            }
         }
         catch ( CommandLineException e )
         {

Modified: continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java (original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java Mon Mar  9 22:02:34 2009
@@ -31,7 +31,6 @@
 import org.apache.continuum.configuration.model.ContinuumConfigurationModel;
 import org.apache.continuum.configuration.model.io.xpp3.ContinuumConfigurationModelXpp3Reader;
 import org.apache.continuum.configuration.model.io.xpp3.ContinuumConfigurationModelXpp3Writer;
-import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -92,7 +91,7 @@
     {
         if ( !configurationFile.exists() )
         {
-            configurationFile.getParentFile().mkdir();
+            configurationFile.getParentFile().mkdirs();
         }
         save( configurationFile );
     }
@@ -111,15 +110,15 @@
     {
         this.generalConfiguration = generalConfiguration;
     }
-    
+
     public void reload( File file )
         throws ContinuumConfigurationException
     {
         try
         {
             ContinuumConfigurationModelXpp3Reader configurationXpp3Reader = new ContinuumConfigurationModelXpp3Reader();
-            ContinuumConfigurationModel configuration = configurationXpp3Reader
-                .read( new InputStreamReader( new FileInputStream( file ) ) );
+            ContinuumConfigurationModel configuration =
+                configurationXpp3Reader.read( new InputStreamReader( new FileInputStream( file ) ) );
 
             this.generalConfiguration = new GeneralConfiguration();
 
@@ -128,14 +127,14 @@
             if ( StringUtils.isNotEmpty( configuration.getBuildOutputDirectory() ) )
             {
                 // TODO take care if file exists ?
-                this.generalConfiguration.setBuildOutputDirectory( new File( configuration
-                    .getBuildOutputDirectory() ) );
+                this.generalConfiguration.setBuildOutputDirectory(
+                    new File( configuration.getBuildOutputDirectory() ) );
             }
             if ( StringUtils.isNotEmpty( configuration.getDeploymentRepositoryDirectory() ) )
             {
                 // TODO take care if file exists ?
-                this.generalConfiguration.setDeploymentRepositoryDirectory( new File( configuration
-                    .getDeploymentRepositoryDirectory() ) );
+                this.generalConfiguration.setDeploymentRepositoryDirectory(
+                    new File( configuration.getDeploymentRepositoryDirectory() ) );
             }
             if ( StringUtils.isNotEmpty( configuration.getWorkingDirectory() ) )
             {
@@ -144,51 +143,55 @@
             }
             if ( configuration.getProxyConfiguration() != null )
             {
-                ProxyConfiguration proxyConfiguration = new ProxyConfiguration( configuration
-                    .getProxyConfiguration().getProxyHost(), configuration.getProxyConfiguration()
-                    .getProxyPassword(), configuration.getProxyConfiguration().getProxyPort(), configuration
-                    .getProxyConfiguration().getProxyUser() );
+                ProxyConfiguration proxyConfiguration =
+                    new ProxyConfiguration( configuration.getProxyConfiguration().getProxyHost(),
+                                            configuration.getProxyConfiguration().getProxyPassword(),
+                                            configuration.getProxyConfiguration().getProxyPort(),
+                                            configuration.getProxyConfiguration().getProxyUser() );
                 this.generalConfiguration.setProxyConfiguration( proxyConfiguration );
             }
             if ( StringUtils.isNotEmpty( configuration.getReleaseOutputDirectory() ) )
             {
                 // TODO take care if file exists?
-                this.generalConfiguration.setReleaseOutputDirectory( new File( configuration
-                    .getReleaseOutputDirectory() ) );
+                this.generalConfiguration.setReleaseOutputDirectory(
+                    new File( configuration.getReleaseOutputDirectory() ) );
             }
             if ( configuration.getBuildAgents() != null )
             {
                 List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
 
-                List<org.apache.continuum.configuration.model.BuildAgentConfiguration> agents = configuration.getBuildAgents();
+                List<org.apache.continuum.configuration.model.BuildAgentConfiguration> agents =
+                    configuration.getBuildAgents();
                 for ( org.apache.continuum.configuration.model.BuildAgentConfiguration agent : agents )
                 {
-                    BuildAgentConfiguration buildAgent = new BuildAgentConfiguration( agent.getUrl(),
-                                                                                      agent.getDescription(),
-                                                                                      agent.isEnabled() );
+                    BuildAgentConfiguration buildAgent =
+                        new BuildAgentConfiguration( agent.getUrl(), agent.getDescription(), agent.isEnabled() );
                     buildAgents.add( buildAgent );
                 }
-                
+
                 this.generalConfiguration.setBuildAgents( buildAgents );
             }
             if ( configuration.getBuildAgentGroups() != null )
             {
                 List<BuildAgentGroupConfiguration> buildAgentGroups = new ArrayList<BuildAgentGroupConfiguration>();
-                List<org.apache.continuum.configuration.model.BuildAgentGroupConfiguration> groups = configuration.getBuildAgentGroups();
-                
+                List<org.apache.continuum.configuration.model.BuildAgentGroupConfiguration> groups =
+                    configuration.getBuildAgentGroups();
+
                 for ( org.apache.continuum.configuration.model.BuildAgentGroupConfiguration group : groups )
                 {
-                    List <BuildAgentConfiguration> agents = new ArrayList<BuildAgentConfiguration>();
-                    List<org.apache.continuum.configuration.model.BuildAgentConfiguration> modelAgents =  group.getBuildAgents();                   
+                    List<BuildAgentConfiguration> agents = new ArrayList<BuildAgentConfiguration>();
+                    List<org.apache.continuum.configuration.model.BuildAgentConfiguration> modelAgents =
+                        group.getBuildAgents();
                     for ( org.apache.continuum.configuration.model.BuildAgentConfiguration modelAgent : modelAgents )
                     {
-                        BuildAgentConfiguration buildAgent = new BuildAgentConfiguration( modelAgent.getUrl(),
-                                                                                          modelAgent.getDescription(),
-                                                                                          modelAgent.isEnabled() ) ;
+                        BuildAgentConfiguration buildAgent =
+                            new BuildAgentConfiguration( modelAgent.getUrl(), modelAgent.getDescription(),
+                                                         modelAgent.isEnabled() );
                         agents.add( buildAgent );
                     }
 
-                    BuildAgentGroupConfiguration groupAgent = new BuildAgentGroupConfiguration( group.getName(),agents );
+                    BuildAgentGroupConfiguration groupAgent =
+                        new BuildAgentGroupConfiguration( group.getName(), agents );
                     buildAgentGroups.add( groupAgent );
                 }
 
@@ -205,7 +208,7 @@
             log.error( e.getMessage(), e );
             throw new RuntimeException( e.getMessage(), e );
         }
-        
+
     }
 
     public void save( File file )
@@ -220,8 +223,8 @@
             // normally not null but NPE free is better !
             if ( this.generalConfiguration.getBuildOutputDirectory() != null )
             {
-                configurationModel.setBuildOutputDirectory( this.generalConfiguration.getBuildOutputDirectory()
-                    .getPath() );
+                configurationModel.setBuildOutputDirectory(
+                    this.generalConfiguration.getBuildOutputDirectory().getPath() );
             }
             if ( this.generalConfiguration.getWorkingDirectory() != null )
             {
@@ -229,51 +232,48 @@
             }
             if ( this.generalConfiguration.getDeploymentRepositoryDirectory() != null )
             {
-                configurationModel.setDeploymentRepositoryDirectory( this.generalConfiguration
-                    .getDeploymentRepositoryDirectory().getPath() );
+                configurationModel.setDeploymentRepositoryDirectory(
+                    this.generalConfiguration.getDeploymentRepositoryDirectory().getPath() );
             }
             if ( this.generalConfiguration.getProxyConfiguration() != null )
             {
-                configurationModel
-                    .setProxyConfiguration( new org.apache.continuum.configuration.model.ProxyConfiguration() );
+                configurationModel.setProxyConfiguration(
+                    new org.apache.continuum.configuration.model.ProxyConfiguration() );
                 configurationModel.getProxyConfiguration().setProxyHost(
-                                                                         this.generalConfiguration
-                                                                             .getProxyConfiguration().getProxyHost() );
+                    this.generalConfiguration.getProxyConfiguration().getProxyHost() );
                 configurationModel.getProxyConfiguration().setProxyPassword(
-                                                                             this.generalConfiguration
-                                                                                 .getProxyConfiguration()
-                                                                                 .getProxyPassword() );
+                    this.generalConfiguration.getProxyConfiguration().getProxyPassword() );
                 configurationModel.getProxyConfiguration().setProxyPort(
-                                                                         this.generalConfiguration
-                                                                             .getProxyConfiguration().getProxyPort() );
+                    this.generalConfiguration.getProxyConfiguration().getProxyPort() );
                 configurationModel.getProxyConfiguration().setProxyHost(
-                                                                         this.generalConfiguration
-                                                                             .getProxyConfiguration().getProxyHost() );
+                    this.generalConfiguration.getProxyConfiguration().getProxyHost() );
             }
             if ( this.generalConfiguration.getReleaseOutputDirectory() != null )
             {
-                configurationModel.setReleaseOutputDirectory( this.generalConfiguration.getReleaseOutputDirectory()
-                    .getPath() );
+                configurationModel.setReleaseOutputDirectory(
+                    this.generalConfiguration.getReleaseOutputDirectory().getPath() );
             }
             if ( this.generalConfiguration.getBuildAgents() != null )
             {
-                List buildAgents = new ArrayList();
+                List<org.apache.continuum.configuration.model.BuildAgentConfiguration> buildAgents =
+                    new ArrayList<org.apache.continuum.configuration.model.BuildAgentConfiguration>();
 
                 for ( BuildAgentConfiguration agent : this.generalConfiguration.getBuildAgents() )
                 {
-                    org.apache.continuum.configuration.model.BuildAgentConfiguration buildAgent = 
+                    org.apache.continuum.configuration.model.BuildAgentConfiguration buildAgent =
                         new org.apache.continuum.configuration.model.BuildAgentConfiguration();
                     buildAgent.setUrl( agent.getUrl() );
                     buildAgent.setDescription( agent.getDescription() );
                     buildAgent.setEnabled( agent.isEnabled() );
-                    
+
                     buildAgents.add( buildAgent );
                 }
                 configurationModel.setBuildAgents( buildAgents );
             }
             if ( this.generalConfiguration.getBuildAgentGroups() != null )
             {
-                List buildAgentGroups = new ArrayList();
+                List<org.apache.continuum.configuration.model.BuildAgentGroupConfiguration> buildAgentGroups =
+                    new ArrayList<org.apache.continuum.configuration.model.BuildAgentGroupConfiguration>();
 
                 for ( BuildAgentGroupConfiguration group : this.generalConfiguration.getBuildAgentGroups() )
                 {
@@ -281,7 +281,8 @@
                         new org.apache.continuum.configuration.model.BuildAgentGroupConfiguration();
                     buildAgentGroup.setName( group.getName() );
 
-                    List buildAgents = new ArrayList();
+                    List<org.apache.continuum.configuration.model.BuildAgentConfiguration> buildAgents =
+                        new ArrayList<org.apache.continuum.configuration.model.BuildAgentConfiguration>();
 
                     if ( group.getBuildAgents() != null )
                     {
@@ -312,10 +313,9 @@
         {
             throw new ContinuumConfigurationException( e.getMessage(), e );
         }
-        
+
     }
 
-    
     // ----------------------------------------
     //  Spring injection
     // ----------------------------------------
@@ -330,5 +330,5 @@
     {
         this.configurationFile = configurationFile;
     }
-    
+
 }

Modified: continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java (original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java Mon Mar  9 22:02:34 2009
@@ -45,16 +45,16 @@
         throws Exception
     {
         log.info( "appserver.base : " + System.getProperty( "appserver.base" ) );
-        
+
         File originalConf = new File( getBasedir(), "src/test/resources/conf/continuum.xml" );
-        
+
         File confUsed = new File( getBasedir(), confFile );
         if ( confUsed.exists() )
         {
             confUsed.delete();
         }
         FileUtils.copyFile( originalConf, confUsed );
-        
+
         super.setUp();
     }
 
@@ -70,17 +70,17 @@
         assertEquals( "http://test", generalConfiguration.getBaseUrl() );
         assertEquals( new File( "myBuildOutputDir" ), generalConfiguration.getBuildOutputDirectory() );
         assertNotNull( generalConfiguration.getBuildAgents() );
-        org.apache.continuum.configuration.BuildAgentConfiguration buildAgentConfig = generalConfiguration.getBuildAgents().get( 0 );
+        org.apache.continuum.configuration.BuildAgentConfiguration buildAgentConfig =
+            generalConfiguration.getBuildAgents().get( 0 );
         assertEquals( "http://buildagent/xmlrpc", buildAgentConfig.getUrl() );
         assertEquals( "linux", buildAgentConfig.getDescription() );
         assertTrue( buildAgentConfig.isEnabled() );
 
         // agent group tests        
         assertNotNull( "agent group", generalConfiguration.getBuildAgentGroups() );
-        BuildAgentGroupConfiguration buildAgentGroupConfig =
-            generalConfiguration.getBuildAgentGroups().get( 0 );
-        assertEquals("group-agent-1", buildAgentGroupConfig.getName() );        
-        BuildAgentConfiguration agentConfig = (BuildAgentConfiguration) buildAgentGroupConfig.getBuildAgents().get( 0 );
+        BuildAgentGroupConfiguration buildAgentGroupConfig = generalConfiguration.getBuildAgentGroups().get( 0 );
+        assertEquals( "group-agent-1", buildAgentGroupConfig.getName() );
+        BuildAgentConfiguration agentConfig = buildAgentGroupConfig.getBuildAgents().get( 0 );
         assertEquals( "http://buildagent/xmlrpc", agentConfig.getUrl() );
         assertEquals( "linux", agentConfig.getDescription() );
     }
@@ -101,7 +101,7 @@
         generalConfiguration.setProxyConfiguration( new ProxyConfiguration() );
         generalConfiguration.getProxyConfiguration().setProxyHost( "localhost" );
         generalConfiguration.getProxyConfiguration().setProxyPort( 8080 );
-        File targetDir = new File(getBasedir(), "target");
+        File targetDir = new File( getBasedir(), "target" );
         generalConfiguration.setBuildOutputDirectory( targetDir );
         BuildAgentConfiguration buildAgentConfiguration = new BuildAgentConfiguration();
         buildAgentConfiguration.setUrl( "http://buildagent/test" );
@@ -117,7 +117,7 @@
         buildAgents.add( buildAgentConfiguration );
         buildAgents.add( buildAgentConfiguration2 );
         BuildAgentGroupConfiguration buildAgentGroupConfiguration = new BuildAgentGroupConfiguration();
-        buildAgentGroupConfiguration.setName( "secret-agent" );        
+        buildAgentGroupConfiguration.setName( "secret-agent" );
         buildAgentGroupConfiguration.setBuildAgents( buildAgents );
 
         List<BuildAgentGroupConfiguration> buildAgentGroups = new ArrayList<BuildAgentGroupConfiguration>();
@@ -134,23 +134,31 @@
         assertTrue( contents.indexOf( "8080" ) > 0 );
         assertTrue( contents.indexOf( "http://buildagent/test" ) > 0 );
         assertTrue( contents.indexOf( "windows xp" ) > 0 );
-        assertTrue( contents.indexOf( "http://buildagent-node-2/test" )> 0);
-        assertTrue( contents.indexOf( "linux" )> 0);
-        assertTrue( contents.indexOf( "secret-agent" )> 0);       
+        assertTrue( contents.indexOf( "http://buildagent-node-2/test" ) > 0 );
+        assertTrue( contents.indexOf( "linux" ) > 0 );
+        assertTrue( contents.indexOf( "secret-agent" ) > 0 );
 
         configuration.reload();
         assertEquals( "http://test/zloug", configuration.getGeneralConfiguration().getBaseUrl() );
         assertEquals( "localhost", configuration.getGeneralConfiguration().getProxyConfiguration().getProxyHost() );
         assertEquals( 8080, configuration.getGeneralConfiguration().getProxyConfiguration().getProxyPort() );
-        assertEquals(targetDir.getPath(), configuration.getGeneralConfiguration().getBuildOutputDirectory().getPath());
-        assertEquals( "http://buildagent/test", configuration.getGeneralConfiguration().getBuildAgents().get( 0 ).getUrl() );        
+        assertEquals( targetDir.getPath(),
+                      configuration.getGeneralConfiguration().getBuildOutputDirectory().getPath() );
+        assertEquals( "http://buildagent/test",
+                      configuration.getGeneralConfiguration().getBuildAgents().get( 0 ).getUrl() );
         assertFalse( configuration.getGeneralConfiguration().getBuildAgents().get( 0 ).isEnabled() );
-        assertEquals( "http://buildagent-node-2/test", configuration.getGeneralConfiguration().getBuildAgents().get( 1 ).getUrl() );
-        assertTrue(configuration.getGeneralConfiguration().getBuildAgents().get( 1 ).isEnabled());
-
-        assertEquals("secret-agent", configuration.getGeneralConfiguration().getBuildAgentGroups().get( 0 ).getName());
-        assertEquals("http://buildagent/test",configuration.getGeneralConfiguration().getBuildAgentGroups().get( 0 ).getBuildAgents().get( 0 ).getUrl() );
-        assertEquals("http://buildagent-node-2/test",configuration.getGeneralConfiguration().getBuildAgentGroups().get( 0 ).getBuildAgents().get( 1 ).getUrl() );
+        assertEquals( "http://buildagent-node-2/test",
+                      configuration.getGeneralConfiguration().getBuildAgents().get( 1 ).getUrl() );
+        assertTrue( configuration.getGeneralConfiguration().getBuildAgents().get( 1 ).isEnabled() );
+
+        assertEquals( "secret-agent",
+                      configuration.getGeneralConfiguration().getBuildAgentGroups().get( 0 ).getName() );
+        assertEquals( "http://buildagent/test",
+                      configuration.getGeneralConfiguration().getBuildAgentGroups().get( 0 ).getBuildAgents().get(
+                          0 ).getUrl() );
+        assertEquals( "http://buildagent-node-2/test",
+                      configuration.getGeneralConfiguration().getBuildAgentGroups().get( 0 ).getBuildAgents().get(
+                          1 ).getUrl() );
         log.info( "generalConfiguration " + configuration.getGeneralConfiguration().toString() );
     }
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckWorkingDirectoryAction.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckWorkingDirectoryAction.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckWorkingDirectoryAction.java Mon Mar  9 22:02:34 2009
@@ -37,7 +37,7 @@
      * @plexus.requirement
      */
     BuildAgentConfigurationService buildAgentConfigurationService;
-    
+
     public void execute( Map context )
         throws Exception
     {
@@ -54,7 +54,7 @@
 
         File[] files = workingDirectory.listFiles();
 
-        context.put( ContinuumBuildAgentUtil.KEY_WORKING_DIRECTORY_EXISTS, Boolean.valueOf( files.length > 0 ) );
+        context.put( ContinuumBuildAgentUtil.KEY_WORKING_DIRECTORY_EXISTS, files.length > 0 );
     }
 
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java Mon Mar  9 22:02:34 2009
@@ -69,15 +69,18 @@
 
         try
         {
-            String scmUserName = ContinuumBuildAgentUtil.getString( context, ContinuumBuildAgentUtil.KEY_SCM_USERNAME, "" );
-            String scmPassword = ContinuumBuildAgentUtil.getString( context, ContinuumBuildAgentUtil.KEY_SCM_PASSWORD, "" );
+            String scmUserName =
+                ContinuumBuildAgentUtil.getString( context, ContinuumBuildAgentUtil.KEY_SCM_USERNAME, "" );
+            String scmPassword =
+                ContinuumBuildAgentUtil.getString( context, ContinuumBuildAgentUtil.KEY_SCM_PASSWORD, "" );
 
             ContinuumScmConfiguration config =
                 createScmConfiguration( project, workingDirectory, scmUserName, scmPassword );
 
             String tag = config.getTag();
-            getLogger().info( "Checking out project: '" + project.getName() + "', id: '" + project.getId() + "' " +
-                "to '" + workingDirectory + "'" + ( tag != null ? " with branch/tag " + tag + "." : "." ) );
+            getLogger().info(
+                "Checking out project: '" + project.getName() + "', id: '" + project.getId() + "' " + "to '" +
+                    workingDirectory + "'" + ( tag != null ? " with branch/tag " + tag + "." : "." ) );
 
             CheckOutScmResult checkoutResult = scm.checkout( config );
             //if ( StringUtils.isNotEmpty( checkoutResult.getRelativePathProjectDirectory() ) )
@@ -213,7 +216,7 @@
         {
             for ( Iterator<String> i = messages.iterator(); i.hasNext(); )
             {
-                message.append( (String) i.next() );
+                message.append( i.next() );
 
                 if ( i.hasNext() )
                 {

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java Mon Mar  9 22:02:34 2009
@@ -197,8 +197,8 @@
      * @param defaultExecutable
      * @return The executable path
      */
-    protected String findExecutable( Project project, String executable, String defaultExecutable,
-                                     boolean resolveExecutable, File workingDirectory )
+    protected String findExecutable( String executable, String defaultExecutable, boolean resolveExecutable,
+                                     File workingDirectory )
     {
         // ----------------------------------------------------------------------
         // If we're not searching the path for the executable, prefix the
@@ -225,11 +225,11 @@
 
             if ( e == null )
             {
-                log.warn( "Could not find the executable '" + executable + "' in this path: " );
+                log.debug( "Could not find the executable '" + executable + "' in this path: " );
 
                 for ( String element : path )
                 {
-                    log.warn( element );
+                    log.debug( element );
                 }
 
                 actualExecutable = defaultExecutable;
@@ -251,15 +251,15 @@
         return actualExecutable;
     }
 
-    protected ContinuumAgentBuildExecutionResult executeShellCommand( Project project, String executable, String arguments,
-                                                                 File output, Map<String, String> environments )
+    protected ContinuumAgentBuildExecutionResult executeShellCommand( Project project, String executable,
+                                                                      String arguments, File output,
+                                                                      Map<String, String> environments )
         throws ContinuumAgentBuildExecutorException, ContinuumAgentBuildCancelledException
     {
 
         File workingDirectory = getWorkingDirectory( project.getId() );
 
-        String actualExecutable =
-            findExecutable( project, executable, defaultExecutable, resolveExecutable, workingDirectory );
+        String actualExecutable = findExecutable( executable, defaultExecutable, resolveExecutable, workingDirectory );
 
         // ----------------------------------------------------------------------
         // Execute the build
@@ -267,9 +267,9 @@
 
         try
         {
-            ExecutionResult result = getShellCommandHelper().executeShellCommand( workingDirectory, actualExecutable,
-                                                                                  arguments, output, project.getId(),
-                                                                                  environments );
+            ExecutionResult result =
+                getShellCommandHelper().executeShellCommand( workingDirectory, actualExecutable, arguments, output,
+                                                             project.getId(), environments );
 
             log.info( "Exit code: " + result.getExitCode() );
 
@@ -290,8 +290,9 @@
         }
         catch ( Exception e )
         {
-            throw new ContinuumAgentBuildExecutorException( "Error while executing shell command. " +
-                "The most common error is that '" + executable + "' " + "is not in your path.", e );
+            throw new ContinuumAgentBuildExecutorException(
+                "Error while executing shell command. " + "The most common error is that '" + executable + "' " +
+                    "is not in your path.", e );
         }
     }
 
@@ -310,9 +311,7 @@
 
     protected String getBuildFileForProject( BuildDefinition buildDefinition )
     {
-        String buildFile = StringUtils.clean( buildDefinition.getBuildFile() );
-        
-        return buildFile;
+        return StringUtils.clean( buildDefinition.getBuildFile() );
     }
 
     protected void updateProject( Project project )
@@ -320,7 +319,7 @@
     {
         Map projectMap = new HashMap();
 
-        projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( project.getId() ) );
+        projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, project.getId() );
         projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_VERSION, project.getVersion() );
         projectMap.put( ContinuumBuildAgentUtil.KEY_ARTIFACT_ID, project.getArtifactId() );
         projectMap.put( ContinuumBuildAgentUtil.KEY_GROUP_ID, project.getGroupId() );
@@ -365,8 +364,10 @@
             projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_URL, "" );
         }
         projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_PARENT, getProjectParent( project.getParent() ) );
-        projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPERS, getProjectDevelopers( project.getDevelopers() ) );
-        projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEPENDENCIES, getProjectDependencies( project.getDependencies() ) );
+        projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPERS,
+                        getProjectDevelopers( project.getDevelopers() ) );
+        projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEPENDENCIES,
+                        getProjectDependencies( project.getDependencies() ) );
         projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_NOTIFIERS, getProjectNotifiers( project.getNotifiers() ) );
 
         try
@@ -463,14 +464,14 @@
                 {
                     map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_TYPE, "" );
                 }
-                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_FROM, new Integer( notifier.getFrom() ) );
-                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_RECIPIENT_TYPE, new Integer( notifier.getRecipientType() ) );
-                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_ENABLED, new Boolean( notifier.isEnabled() ) );
-                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_ERROR, new Boolean( notifier.isSendOnError() ) );
-                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_SUCCESS, new Boolean( notifier.isSendOnSuccess() ) );
-                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_FAILURE, new Boolean( notifier.isSendOnFailure() ) );
-                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_SCMFAILURE, new Boolean( notifier.isSendOnScmFailure() ) );
-                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_WARNING, new Boolean( notifier.isSendOnWarning() ) );
+                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_FROM, notifier.getFrom() );
+                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_RECIPIENT_TYPE, notifier.getRecipientType() );
+                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_ENABLED, notifier.isEnabled() );
+                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_ERROR, notifier.isSendOnError() );
+                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_SUCCESS, notifier.isSendOnSuccess() );
+                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_FAILURE, notifier.isSendOnFailure() );
+                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_SCMFAILURE, notifier.isSendOnScmFailure() );
+                map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_WARNING, notifier.isSendOnWarning() );
             }
         }
         return pNotifiers;
@@ -479,7 +480,7 @@
     public boolean isBuilding( Project project )
     {
         return project.getState() == ContinuumProjectState.BUILDING ||
-               getShellCommandHelper().isRunning( project.getId() );
+            getShellCommandHelper().isRunning( project.getId() );
     }
 
     public void killProcess( Project project )
@@ -487,7 +488,8 @@
         getShellCommandHelper().killProcess( project.getId() );
     }
 
-    public List<Artifact> getDeployableArtifacts( Project project, File workingDirectory, BuildDefinition buildDefinition )
+    public List<Artifact> getDeployableArtifacts( Project project, File workingDirectory,
+                                                  BuildDefinition buildDefinition )
         throws ContinuumAgentBuildExecutorException
     {
         // Not supported by this builder

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java Mon Mar  9 22:02:34 2009
@@ -20,7 +20,6 @@
  */
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.continuum.buildagent.build.execution.ContinuumAgentBuildExecutor;
@@ -40,7 +39,7 @@
     /**
      * @plexus.requirement role="org.apache.continuum.buildagent.build.execution.ContinuumAgentBuildExecutor"
      */
-    private Map executors;
+    private Map<String, ContinuumAgentBuildExecutor> executors;
 
     // ----------------------------------------------------------------------
     // Component Lifecycle
@@ -50,7 +49,7 @@
     {
         if ( executors == null )
         {
-            executors = new HashMap();
+            executors = new HashMap<String, ContinuumAgentBuildExecutor>();
         }
 
         if ( executors.size() == 0 )
@@ -61,9 +60,9 @@
         {
             log.info( "Build executors:" );
 
-            for ( Iterator it = executors.keySet().iterator(); it.hasNext(); )
+            for ( String key : executors.keySet() )
             {
-                log.info( "  " + it.next().toString() );
+                log.info( "  " + key );
             }
         }
     }
@@ -75,7 +74,7 @@
     public ContinuumAgentBuildExecutor getBuildExecutor( String builderType )
         throws ContinuumException
     {
-        ContinuumAgentBuildExecutor executor = (ContinuumAgentBuildExecutor) executors.get( builderType );
+        ContinuumAgentBuildExecutor executor = executors.get( builderType );
 
         if ( executor == null )
         {

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelper.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelper.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelper.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelper.java Mon Mar  9 22:02:34 2009
@@ -1,5 +1,24 @@
 package org.apache.continuum.buildagent.build.execution.maven.m1;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.io.File;
 
 import org.apache.maven.continuum.model.project.Project;

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelperException.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelperException.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelperException.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/BuildAgentMavenOneMetadataHelperException.java Mon Mar  9 22:02:34 2009
@@ -1,5 +1,24 @@
 package org.apache.continuum.buildagent.build.execution.maven.m1;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 public class BuildAgentMavenOneMetadataHelperException
     extends Exception
 {

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/DefaultBuildAgentMavenOneMetadataHelper.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/DefaultBuildAgentMavenOneMetadataHelper.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/DefaultBuildAgentMavenOneMetadataHelper.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/DefaultBuildAgentMavenOneMetadataHelper.java Mon Mar  9 22:02:34 2009
@@ -1,5 +1,24 @@
 package org.apache.continuum.buildagent.build.execution.maven.m1;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
@@ -324,7 +343,7 @@
         else
         {
             project.setDescription( shortDescription );
-        
+
         }
 
         project.setScmUrl( scmConnection );

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java Mon Mar  9 22:02:34 2009
@@ -75,8 +75,8 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * @plexus.component role="org.apache.continuum.buildagent.build.execution.maven.m2.BuildAgentMavenBuilderHelper" 
- * role-hint="default" 
+ * @plexus.component role="org.apache.continuum.buildagent.build.execution.maven.m2.BuildAgentMavenBuilderHelper"
+ * role-hint="default"
  */
 public class DefaultBuildAgentMavenBuilderHelper
     implements BuildAgentMavenBuilderHelper, Contextualizable, Initializable
@@ -104,7 +104,7 @@
     private ArtifactRepositoryLayout defaultRepositoryLayout;
 
     private PlexusContainer container;
-    
+
     public MavenProject getMavenProject( ContinuumProjectBuildingResult result, File file )
     {
         MavenProject project;
@@ -166,8 +166,7 @@
 
             if ( cause instanceof ArtifactNotFoundException )
             {
-                result.addError( ContinuumProjectBuildingResult.ERROR_ARTIFACT_NOT_FOUND,
-                                 ( (ArtifactNotFoundException) cause ).toString() );
+                result.addError( ContinuumProjectBuildingResult.ERROR_ARTIFACT_NOT_FOUND, ( cause ).toString() );
                 return null;
             }
 
@@ -323,7 +322,7 @@
         {
             List<ProjectDeveloper> developers = new ArrayList<ProjectDeveloper>();
 
-            for ( Developer d : (List<Developer>)mavenProject.getDevelopers() )
+            for ( Developer d : (List<Developer>) mavenProject.getDevelopers() )
             {
                 ProjectDeveloper cd = new ProjectDeveloper();
 
@@ -364,7 +363,7 @@
 
         List<ProjectDependency> dependencies = new ArrayList<ProjectDependency>();
 
-        for ( Dependency dependency : (List<Dependency>)mavenProject.getDependencies() )
+        for ( Dependency dependency : (List<Dependency>) mavenProject.getDependencies() )
         {
             ProjectDependency cd = new ProjectDependency();
 
@@ -377,7 +376,7 @@
             dependencies.add( cd );
         }
 
-        for ( Plugin dependency : (List<Plugin>)mavenProject.getBuildPlugins() )
+        for ( Plugin dependency : (List<Plugin>) mavenProject.getBuildPlugins() )
         {
             ProjectDependency cd = new ProjectDependency();
 
@@ -390,7 +389,7 @@
             dependencies.add( cd );
         }
 
-        for ( ReportPlugin dependency : (List<ReportPlugin>)mavenProject.getReportPlugins() )
+        for ( ReportPlugin dependency : (List<ReportPlugin>) mavenProject.getReportPlugins() )
         {
             ProjectDependency cd = new ProjectDependency();
 
@@ -403,7 +402,7 @@
             dependencies.add( cd );
         }
 
-        for ( Extension dependency : (List<Extension>)mavenProject.getBuildExtensions() )
+        for ( Extension dependency : (List<Extension>) mavenProject.getBuildExtensions() )
         {
             ProjectDependency cd = new ProjectDependency();
 
@@ -477,13 +476,13 @@
     }
 
     private List<ProjectNotifier> getNotifiers( ContinuumProjectBuildingResult result, MavenProject mavenProject,
-                               Project continuumProject )
+                                                Project continuumProject )
     {
         List<ProjectNotifier> notifiers = new ArrayList<ProjectNotifier>();
 
         if ( mavenProject.getCiManagement() != null && mavenProject.getCiManagement().getNotifiers() != null )
         {
-            for ( Notifier projectNotifier : (List<Notifier>)mavenProject.getCiManagement().getNotifiers() )
+            for ( Notifier projectNotifier : (List<Notifier>) mavenProject.getCiManagement().getNotifiers() )
             {
                 ProjectNotifier notifier = new ProjectNotifier();
 
@@ -547,10 +546,10 @@
 
     private ArtifactRepository getRepository( Settings settings )
     {
-        return artifactRepositoryFactory.createArtifactRepository( "local", "file://" + settings.getLocalRepository(), 
+        return artifactRepositoryFactory.createArtifactRepository( "local", "file://" + settings.getLocalRepository(),
                                                                    defaultRepositoryLayout, null, null );
     }
-    
+
     public String getProjectName( MavenProject project )
     {
         String name = project.getName();
@@ -562,7 +561,7 @@
 
         return name;
     }
-    
+
     private void writeSettings( Settings settings )
     {
         StringWriter sWriter = new StringWriter();
@@ -620,7 +619,7 @@
             log.warn( "Cannot serialize POM to XML.", e );
         }
     }
-    
+
     private void writeActiveProfileStatement( MavenProject project )
     {
         List<Profile> profiles = project.getActiveProfiles();
@@ -644,8 +643,8 @@
 
             for ( Profile profile : profiles )
             {
-                message.append( "\n - " ).append( profile.getId() ).append( " (source: " )
-                    .append( profile.getSource() ).append( ")" );
+                message.append( "\n - " ).append( profile.getId() ).append( " (source: " ).append(
+                    profile.getSource() ).append( ")" );
             }
 
         }
@@ -676,7 +675,7 @@
             throw new InitializationException( "Can't initialize '" + getClass().getName() + "'", e );
         }
     }
-    
+
     /**
      * @todo [BP] this might not be required if there is a better way to pass
      * them in. It doesn't feel quite right.

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java Mon Mar  9 22:02:34 2009
@@ -84,19 +84,21 @@
     {
         try
         {
-            ContinuumBuildAgentConfigurationModelXpp3Reader configurationXpp3Reader = 
+            ContinuumBuildAgentConfigurationModelXpp3Reader configurationXpp3Reader =
                 new ContinuumBuildAgentConfigurationModelXpp3Reader();
-            ContinuumBuildAgentConfigurationModel configuration = configurationXpp3Reader
-                .read( new InputStreamReader( new FileInputStream( file ) ) );
+            ContinuumBuildAgentConfigurationModel configuration =
+                configurationXpp3Reader.read( new InputStreamReader( new FileInputStream( file ) ) );
 
             this.generalBuildAgentConfiguration = new GeneralBuildAgentConfiguration();
             if ( StringUtils.isNotEmpty( configuration.getBuildOutputDirectory() ) )
             {
-                this.generalBuildAgentConfiguration.setBuildOutputDirectory( new File( configuration.getBuildOutputDirectory() ) );
+                this.generalBuildAgentConfiguration.setBuildOutputDirectory(
+                    new File( configuration.getBuildOutputDirectory() ) );
             }
             if ( StringUtils.isNotEmpty( configuration.getWorkingDirectory() ) )
             {
-                this.generalBuildAgentConfiguration.setWorkingDirectory( new File( configuration.getWorkingDirectory() ) );
+                this.generalBuildAgentConfiguration.setWorkingDirectory(
+                    new File( configuration.getWorkingDirectory() ) );
             }
             this.generalBuildAgentConfiguration.setContinuumServerUrl( configuration.getContinuumServerUrl() );
             this.generalBuildAgentConfiguration.setInstallations( configuration.getInstallations() );
@@ -118,7 +120,7 @@
     {
         if ( !configurationFile.exists() )
         {
-            configurationFile.getParentFile().mkdir();
+            configurationFile.getParentFile().mkdirs();
         }
         save( configurationFile );
     }
@@ -131,16 +133,19 @@
             ContinuumBuildAgentConfigurationModel configurationModel = new ContinuumBuildAgentConfigurationModel();
             if ( this.generalBuildAgentConfiguration.getBuildOutputDirectory() != null )
             {
-                configurationModel.setBuildOutputDirectory( this.generalBuildAgentConfiguration.getBuildOutputDirectory().getPath() );
+                configurationModel.setBuildOutputDirectory(
+                    this.generalBuildAgentConfiguration.getBuildOutputDirectory().getPath() );
             }
             if ( this.generalBuildAgentConfiguration.getWorkingDirectory() != null )
             {
-                configurationModel.setWorkingDirectory( this.generalBuildAgentConfiguration.getWorkingDirectory().getPath() );
+                configurationModel.setWorkingDirectory(
+                    this.generalBuildAgentConfiguration.getWorkingDirectory().getPath() );
             }
             configurationModel.setContinuumServerUrl( this.generalBuildAgentConfiguration.getContinuumServerUrl() );
             configurationModel.setInstallations( this.generalBuildAgentConfiguration.getInstallations() );
 
-            ContinuumBuildAgentConfigurationModelXpp3Writer writer = new ContinuumBuildAgentConfigurationModelXpp3Writer();
+            ContinuumBuildAgentConfigurationModelXpp3Writer writer =
+                new ContinuumBuildAgentConfigurationModelXpp3Writer();
             FileWriter fileWriter = new FileWriter( file );
             writer.write( fileWriter, configurationModel );
         }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java Mon Mar  9 22:02:34 2009
@@ -160,28 +160,26 @@
         projectGroup.setId( buildContext.getProjectGroupId() );
         projectGroup.setName( buildContext.getProjectGroupName() );
         project.setProjectGroup( projectGroup );
-        
+
         actionContext.put( ContinuumBuildAgentUtil.KEY_PROJECT, project );
-        actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION, BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION,
+                           BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
         actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
-        actionContext.put( ContinuumBuildAgentUtil.KEY_ENVIRONMENTS, getEnvironments( buildContext.getBuildDefinitionId(), 
-                                                                                      getInstallationType( buildContext ) ) );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_ENVIRONMENTS,
+                           getEnvironments( buildContext.getBuildDefinitionId(),
+                                            getInstallationType( buildContext ) ) );
         actionContext.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY, buildContext.getLocalRepository() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_RESULT, buildContext.getScmResult() );
         buildContext.setActionContext( actionContext );
 
         buildContext.setBuildStartTime( System.currentTimeMillis() );
     }
-    
+
     private boolean checkScmResult( BuildContext buildContext )
     {
-        if ( buildContext.getScmResult() == null || !buildContext.getScmResult().isSuccess() )
-        {
-            return false;
-        }
+        return !( buildContext.getScmResult() == null || !buildContext.getScmResult().isSuccess() );
 
-        return true;
     }
 
     private void startBuild( BuildContext buildContext )
@@ -206,13 +204,13 @@
         BuildResult buildResult = buildContext.getBuildResult();
 
         Map<String, Object> result = new HashMap<String, Object>();
-        result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( buildContext.getProjectId() ) );
-        result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( buildContext.getBuildDefinitionId() ) );
-        result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, new Integer( buildContext.getTrigger() ) );
-        result.put( ContinuumBuildAgentUtil.KEY_BUILD_STATE, new Integer( buildResult.getState() ) );
-        result.put( ContinuumBuildAgentUtil.KEY_START_TIME, new Long( buildResult.getStartTime() ).toString() );
-        result.put( ContinuumBuildAgentUtil.KEY_END_TIME, new Long( buildResult.getEndTime() ).toString() );
-        result.put( ContinuumBuildAgentUtil.KEY_BUILD_EXIT_CODE, new Integer( buildResult.getExitCode() ) );
+        result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );
+        result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
+        result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+        result.put( ContinuumBuildAgentUtil.KEY_BUILD_STATE, buildResult.getState() );
+        result.put( ContinuumBuildAgentUtil.KEY_START_TIME, Long.toString( buildResult.getStartTime() ) );
+        result.put( ContinuumBuildAgentUtil.KEY_END_TIME, Long.toString( buildResult.getEndTime() ) );
+        result.put( ContinuumBuildAgentUtil.KEY_BUILD_EXIT_CODE, buildResult.getExitCode() );
         if ( buildContext.getLatestUpdateDate() != null )
         {
             result.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, buildContext.getLatestUpdateDate() );
@@ -247,16 +245,17 @@
         catch ( ContinuumException e )
         {
             log.error( "Failed to return build result for project '" + buildContext.getProjectName() + "'", e );
-            throw new TaskExecutionException( "Failed to return build result for project '" + buildContext.getProjectName() + "'", e );
+            throw new TaskExecutionException(
+                "Failed to return build result for project '" + buildContext.getProjectName() + "'", e );
         }
     }
 
     private void performAction( String actionName, BuildContext context )
         throws TaskExecutionException
     {
-        String error = null;
-        TaskExecutionException exception = null;
-    
+        String error;
+        TaskExecutionException exception;
+
         try
         {
             log.info( "Performing action " + actionName );
@@ -271,13 +270,13 @@
         catch ( ScmRepositoryException e )
         {
             error = getValidationMessages( e ) + "\n" + ContinuumBuildAgentUtil.throwableToString( e );
-    
+
             exception = new TaskExecutionException( "SCM error while executing '" + actionName + "'", e );
         }
         catch ( ScmException e )
         {
             error = ContinuumBuildAgentUtil.throwableToString( e );
-    
+
             exception = new TaskExecutionException( "SCM error while executing '" + actionName + "'", e );
         }
         catch ( Exception e )
@@ -294,7 +293,7 @@
     private void updateBuildResult( BuildContext context, String error )
     {
         context.setBuildResult( ContinuumBuildAgentUtil.getBuildResult( context.getActionContext(), null ) );
-        
+
         if ( context.getBuildResult() == null )
         {
             BuildResult build = new BuildResult();
@@ -346,7 +345,7 @@
         try
         {
             File buildOutputFile = buildAgentConfigurationService.getBuildOutputFile( projectId );
-        
+
             if ( buildOutputFile.exists() )
             {
                 return StringEscapeUtils.escapeHtml( FileUtils.fileRead( buildOutputFile ) );
@@ -371,14 +370,15 @@
         catch ( ContinuumException e )
         {
             log.error( "Error while retrieving environments of build definition: " + buildDefinitionId, e );
-            throw new TaskExecutionException( "Error while retrieving environments of build definition: " + buildDefinitionId, e );
+            throw new TaskExecutionException(
+                "Error while retrieving environments of build definition: " + buildDefinitionId, e );
         }
     }
 
     private String getInstallationType( BuildContext buildContext )
     {
         String executorId = buildContext.getExecutorId();
-        
+
         if ( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR.equals( executorId ) )
         {
             return BuildAgentInstallationService.MAVEN2_TYPE;
@@ -399,9 +399,9 @@
         throws TaskExecutionException
     {
         Map map = new HashMap();
-        map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( context.getProjectId() ) );
-        map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( context.getBuildDefinitionId() ) );
-        map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, new Integer( context.getTrigger() ) );
+        map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, context.getProjectId() );
+        map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, context.getBuildDefinitionId() );
+        map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, context.getTrigger() );
         map.put( ContinuumBuildAgentUtil.KEY_SCM_CHANGES, getScmChanges( context.getScmResult() ) );
         map.put( ContinuumBuildAgentUtil.KEY_MAVEN_PROJECT, getMavenProject( context ) );
         if ( context.getLatestUpdateDate() != null )
@@ -428,7 +428,7 @@
         {
             for ( Object obj : scmResult.getChanges() )
             {
-                ChangeSet changeSet = (ChangeSet) obj; 
+                ChangeSet changeSet = (ChangeSet) obj;
 
                 Map map = new HashMap();
                 if ( StringUtils.isNotEmpty( changeSet.getAuthor() ) )
@@ -491,7 +491,7 @@
                 }
                 else
                 {
-                    map.put( ContinuumBuildAgentUtil.KEY_CHANGEFILE_STATUS, "" );   
+                    map.put( ContinuumBuildAgentUtil.KEY_CHANGEFILE_STATUS, "" );
                 }
                 scmChangeFiles.add( map );
             }
@@ -506,7 +506,8 @@
 
         try
         {
-            ContinuumAgentBuildExecutor buildExecutor = buildAgentBuildExecutorManager.getBuildExecutor( context.getExecutorId() );
+            ContinuumAgentBuildExecutor buildExecutor =
+                buildAgentBuildExecutorManager.getBuildExecutor( context.getExecutorId() );
 
             BuildDefinition buildDefinition = BuildContextToBuildDefinition.getBuildDefinition( context );
 
@@ -527,7 +528,7 @@
         }
         catch ( ContinuumException e )
         {
-            log.error( "Error getting build executor", e );   
+            log.error( "Error getting build executor", e );
         }
 
         return mavenProject;

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java?rev=751864&r1=751863&r2=751864&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java Mon Mar  9 22:02:34 2009
@@ -93,10 +93,10 @@
 
                     log.info( "Starting prepare build" );
                     startPrepareBuild( buildContext );
-                    
+
                     log.info( "Initializing prepare build" );
                     initializeActionContext( buildContext );
-                    
+
                     try
                     {
                         if ( buildDef.isBuildFresh() )
@@ -104,7 +104,7 @@
                             log.info( "Clean up working directory" );
                             cleanWorkingDirectory( buildContext );
                         }
-            
+
                         log.info( "Updating working directory" );
                         updateWorkingDirectory( buildContext );
 
@@ -142,11 +142,12 @@
         throws TaskExecutionException
     {
         Map<String, Object> actionContext = buildContext.getActionContext();
-        
-        if ( actionContext == null || !( ContinuumBuildAgentUtil.getScmRootState( actionContext ) == ContinuumProjectState.UPDATING ) ) 
+
+        if ( actionContext == null ||
+            !( ContinuumBuildAgentUtil.getScmRootState( actionContext ) == ContinuumProjectState.UPDATING ) )
         {
             Map<String, Object> map = new HashMap<String, Object>();
-            map.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( buildContext.getProjectGroupId() ) );
+            map.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, buildContext.getProjectGroupId() );
             map.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, buildContext.getScmRootAddress() );
 
             try
@@ -159,97 +160,96 @@
             }
         }
     }
-    
+
     private void initializeActionContext( BuildContext buildContext )
     {
         Map<String, Object> actionContext = new HashMap<String, Object>();
-    
+
         actionContext.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_PROJECT, BuildContextToProject.getProject( buildContext ) );
-        actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION, BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION,
+                           BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
         actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_STATE, ContinuumProjectState.UPDATING );
         actionContext.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, buildContext.getProjectGroupId() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, buildContext.getScmRootAddress() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_OLD_SCM_RESULT, buildContext.getOldScmResult() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, buildContext.getLatestUpdateDate() );
-    
+
         buildContext.setActionContext( actionContext );
     }
-    
+
     private boolean checkProjectScmRoot( Map context )
     {
-        if ( context != null && ContinuumBuildAgentUtil.getScmRootState( context ) == ContinuumProjectState.ERROR )
-        {
-            return false;
-        }
-    
-        return true;
+        return !( context != null &&
+            ContinuumBuildAgentUtil.getScmRootState( context ) == ContinuumProjectState.ERROR );
+
     }
-    
+
     private void cleanWorkingDirectory( BuildContext buildContext )
         throws TaskExecutionException
     {
         performAction( "clean-agent-working-directory", buildContext );
     }
-    
+
     private void updateWorkingDirectory( BuildContext buildContext )
         throws TaskExecutionException
     {
         Map<String, Object> actionContext = buildContext.getActionContext();
-    
+
         performAction( "check-agent-working-directory", buildContext );
-        
+
         boolean workingDirectoryExists =
             ContinuumBuildAgentUtil.getBoolean( actionContext, ContinuumBuildAgentUtil.KEY_WORKING_DIRECTORY_EXISTS );
-    
+
         ScmResult scmResult;
-    
-        Date date = null;
-    
+
+        Date date;
+
         if ( workingDirectoryExists )
         {
             performAction( "update-agent-working-directory", buildContext );
-    
+
             scmResult = ContinuumBuildAgentUtil.getUpdateScmResult( actionContext, null );
-    
+
             date = ContinuumBuildAgentUtil.getLatestUpdateDate( actionContext );
-    
+
             if ( date == null )
             {
                 // try to get latest update date from change log because sometimes date in the changefile is 0
                 performAction( "changelog-agent-project", buildContext );
-    
+
                 date = ContinuumBuildAgentUtil.getLatestUpdateDate( actionContext );
             }
         }
         else
         {
             Project project = ContinuumBuildAgentUtil.getProject( actionContext );
-    
+
             actionContext.put( ContinuumBuildAgentUtil.KEY_WORKING_DIRECTORY,
-                               buildAgentConfigurationService.getWorkingDirectory( project.getId() ).getAbsolutePath() );
-    
+                               buildAgentConfigurationService.getWorkingDirectory(
+                                   project.getId() ).getAbsolutePath() );
+
             performAction( "checkout-agent-project", buildContext );
-    
+
             scmResult = ContinuumBuildAgentUtil.getCheckoutScmResult( actionContext, null );
-    
+
             performAction( "changelog-agent-project", buildContext );
-    
+
             date = ContinuumBuildAgentUtil.getLatestUpdateDate( actionContext );
         }
-    
+
         buildContext.setScmResult( scmResult );
         buildContext.setLatestUpdateDate( date );
         actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_RESULT, scmResult );
     }
-    
+
     private void endProjectPrepareBuild( BuildContext buildContext )
         throws TaskExecutionException
     {
         Map<String, Object> context = buildContext.getActionContext();
-    
+
         ScmResult scmResult = ContinuumBuildAgentUtil.getScmResult( context, null );
-    
+
         if ( scmResult == null || !scmResult.isSuccess() )
         {
             context.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_STATE, ContinuumProjectState.ERROR );
@@ -259,21 +259,24 @@
             buildContext.setScmResult( scmResult );
         }
     }
-    
+
     private void endPrepareBuild( Map context )
         throws TaskExecutionException
     {
         if ( context != null )
         {
             Map<String, Object> result = new HashMap<String, Object>();
-            result.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( ContinuumBuildAgentUtil.getProjectGroupId( context ) ) );
-            result.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, ContinuumBuildAgentUtil.getScmRootAddress( context ) );
-            result.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_STATE, new Integer( ContinuumBuildAgentUtil.getScmRootState( context ) ) );
-            
+            result.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID,
+                        ContinuumBuildAgentUtil.getProjectGroupId( context ) );
+            result.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS,
+                        ContinuumBuildAgentUtil.getScmRootAddress( context ) );
+            result.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_STATE,
+                        ContinuumBuildAgentUtil.getScmRootState( context ) );
+
             if ( ContinuumBuildAgentUtil.getScmRootState( context ) == ContinuumProjectState.ERROR )
             {
                 String error = convertScmResultToError( ContinuumBuildAgentUtil.getScmResult( context, null ) );
-                
+
                 if ( StringUtils.isEmpty( error ) )
                 {
                     result.put( ContinuumBuildAgentUtil.KEY_SCM_ERROR, "" );
@@ -349,7 +352,7 @@
         throws TaskExecutionException
     {
         TaskExecutionException exception = null;
-    
+
         try
         {
             log.info( "Performing action " + actionName );
@@ -364,16 +367,16 @@
         {
             exception = new TaskExecutionException( "Error executing action '" + actionName + "'", e );
         }
-        
+
         ScmResult result = new ScmResult();
-        
+
         result.setSuccess( false );
-        
+
         result.setException( ContinuumBuildAgentUtil.throwableToString( exception ) );
 
         buildContext.setScmResult( result );
         buildContext.getActionContext().put( ContinuumBuildAgentUtil.KEY_UPDATE_SCM_RESULT, result );
-        
+
         throw exception;
     }
 
@@ -413,7 +416,7 @@
     {
         Map map = new HashMap();
         map.put( ContinuumBuildAgentUtil.KEY_BUILD_CONTEXTS, buildContexts );
-        
+
         BuildContext context = new BuildContext();
         context.setActionContext( map );
 



Mime
View raw message