continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r790386 - in /continuum/branches/continuum-1.3.x: continuum-api/src/main/java/org/apache/continuum/dao/ continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/ cont...
Date Wed, 01 Jul 2009 21:27:26 GMT
Author: evenisse
Date: Wed Jul  1 21:27:25 2009
New Revision: 790386

URL: http://svn.apache.org/viewvc?rev=790386&view=rev
Log:
[CONTINUUM-2284] Improve performance by reducing the number of requests and by reducing the number of results in requests
Remove some unused methods
Add some TODO in DefaultContinuum

Modified:
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
    continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
    continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
    continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java Wed Jul  1 21:27:25 2009
@@ -19,13 +19,13 @@
  * under the License.
  */
 
+import java.util.List;
+import java.util.Map;
+
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -45,30 +45,52 @@
 
     BuildResult getLatestBuildResultForProject( int projectId );
 
+    BuildResult getLatestBuildResultForProjectWithDetails( int projectId );
+
     BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId );
 
-    List<BuildResult> getBuildResultsInSuccessForProject( int projectId, long fromDate );
+    BuildResult getLatestBuildResultInSuccess( int projectId );
+
+    BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId )
+        throws ContinuumStoreException;
 
     long getNbBuildResultsForProject( int projectId );
 
+    /**
+     * Returns the list of build results between the fromdate and the buildResult defined by its toBuildResultId
+     *
+     * @param projectId       The project id
+     * @param fromDate        the from date
+     * @param tobuildResultId the build result id
+     * @return the list of build results
+     */
+    List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, long fromDate, int tobuildResultId );
+
+    /**
+     * Returns the number of build results in success since fromDate
+     *
+     * @param projectId The project id
+     * @param fromDate  The from date
+     * @return the number of build results
+     */
+    long getNbBuildResultsInSuccessForProject( int projectId, long fromDate );
+
     List<BuildResult> getBuildResultsForProject( int projectId );
 
     List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex );
 
     /**
-     * @since 1.2
      * @param projectId
-     * @param startIndex
+     * @param startId
      * @return the returned list will contains all BuildResult for this project after the startId
+     * @since 1.2
      */
     List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
-        throws ContinuumStoreException;   
-    
-    List<BuildResult> getBuildResultsForProject( int projectId, long fromDate );
+        throws ContinuumStoreException;
 
     Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId );
 
-    Map<Integer, BuildResult> getLatestBuildResults();
+    Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
 
     List<BuildResult> getBuildResultByBuildNumber( int projectId, int buildNumber );
 
@@ -77,9 +99,5 @@
     List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId, long startIndex,
                                                         long endIndex );
 
-    Map<Integer, BuildResult> getBuildResultsInSuccess();
-
-    Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
-
     List<BuildResult> getAllBuildsForAProjectByDate( int projectId );
 }

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Wed Jul  1 21:27:25 2009
@@ -65,13 +65,6 @@
     public ProjectGroup getProjectGroup( int projectGroupId )
         throws ContinuumException;
 
-    /**
-     * Get all {@link ProjectGroup}s and their {@link Project}s
-     *
-     * @return {@link Collection} &lt;{@link ProjectGroup}>
-     */
-    public Collection<ProjectGroup> getAllProjectGroupsWithProjects();
-
     public List<ProjectGroup> getAllProjectGroupsWithBuildDetails();
 
     public List<ProjectGroup> getAllProjectGroups();
@@ -157,9 +150,6 @@
     void buildProjects()
         throws ContinuumException;
 
-    void buildProjectsWithBuildDefinition( int buildDefinitionId )
-        throws ContinuumException;
-
     void buildProjectsWithBuildDefinition( List<Project> projects, List<BuildDefinition> bds )
         throws ContinuumException;
 
@@ -169,9 +159,6 @@
     void buildProjects( int trigger )
         throws ContinuumException;
 
-    void buildProjects( int trigger, int buildDefinitionId )
-        throws ContinuumException;
-
     void buildProjects( Schedule schedule )
         throws ContinuumException;
 

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java Wed Jul  1 21:27:25 2009
@@ -38,7 +38,7 @@
     public BuildResult convertMapToBuildResult( Map<String, Object> context )
     {
         BuildResult buildResult = new BuildResult();
-    
+
         buildResult.setStartTime( ContinuumBuildConstant.getStartTime( context ) );
         buildResult.setEndTime( ContinuumBuildConstant.getEndTime( context ) );
         buildResult.setError( ContinuumBuildConstant.getBuildError( context ) );
@@ -46,7 +46,7 @@
         buildResult.setState( ContinuumBuildConstant.getBuildState( context ) );
         buildResult.setTrigger( ContinuumBuildConstant.getTrigger( context ) );
         buildResult.setBuildUrl( ContinuumBuildConstant.getBuildAgentUrl( context ) );
-    
+
         return buildResult;
     }
 
@@ -57,40 +57,39 @@
         {
             return null;
         }
-    
+
         try
         {
             Project project = projectDao.getProjectWithAllDetails( ContinuumBuildConstant.getProjectId( context ) );
             List<ProjectDependency> dependencies = project.getDependencies();
-    
+
             if ( dependencies == null )
             {
                 dependencies = new ArrayList<ProjectDependency>();
             }
-    
+
             if ( project.getParent() != null )
             {
                 dependencies.add( project.getParent() );
             }
-    
+
             if ( dependencies.isEmpty() )
             {
                 return null;
             }
-    
+
             List<ProjectDependency> modifiedDependencies = new ArrayList<ProjectDependency>();
-    
+
             for ( ProjectDependency dep : dependencies )
             {
                 Project dependencyProject =
                     projectDao.getProject( dep.getGroupId(), dep.getArtifactId(), dep.getVersion() );
-    
+
                 if ( dependencyProject != null )
                 {
-                    List<BuildResult> buildResults =
-                        buildResultDao.getBuildResultsInSuccessForProject( dependencyProject.getId(),
-                                                                           oldBuildResult.getEndTime() );
-                    if ( buildResults != null && !buildResults.isEmpty() )
+                    long nbBuild = buildResultDao.getNbBuildResultsInSuccessForProject( dependencyProject.getId(),
+                                                                                        oldBuildResult.getEndTime() );
+                    if ( nbBuild > 0 )
                     {
                         log.debug( "Dependency changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
                             dep.getVersion() );
@@ -108,21 +107,21 @@
                         dep.getVersion() );
                 }
             }
-    
+
             return modifiedDependencies;
         }
         catch ( ContinuumStoreException e )
         {
             log.warn( "Can't get the project dependencies", e );
         }
-    
+
         return null;
     }
 
     public ScmResult getScmResult( Map<String, Object> context )
     {
         Map<String, Object> map = ContinuumBuildConstant.getScmResult( context );
-    
+
         if ( !map.isEmpty() )
         {
             ScmResult scmResult = new ScmResult();
@@ -132,10 +131,10 @@
             scmResult.setProviderMessage( ContinuumBuildConstant.getScmProviderMessage( map ) );
             scmResult.setSuccess( ContinuumBuildConstant.isScmSuccess( map ) );
             scmResult.setChanges( getScmChanges( map ) );
-    
+
             return scmResult;
         }
-    
+
         return null;
     }
 
@@ -143,7 +142,7 @@
     {
         List<ChangeSet> changes = new ArrayList<ChangeSet>();
         List<Map<String, Object>> scmChanges = ContinuumBuildConstant.getScmChanges( context );
-    
+
         if ( scmChanges != null )
         {
             for ( Map<String, Object> map : scmChanges )
@@ -156,14 +155,14 @@
                 changes.add( changeSet );
             }
         }
-    
+
         return changes;
     }
 
     private void setChangeFiles( ChangeSet changeSet, Map<String, Object> context )
     {
         List<Map<String, Object>> changeFiles = ContinuumBuildConstant.getChangeSetFiles( context );
-    
+
         if ( changeFiles != null )
         {
             for ( Map<String, Object> map : changeFiles )
@@ -172,7 +171,7 @@
                 changeFile.setName( ContinuumBuildConstant.getChangeFileName( map ) );
                 changeFile.setRevision( ContinuumBuildConstant.getChangeFileRevision( map ) );
                 changeFile.setStatus( ContinuumBuildConstant.getChangeFileStatus( map ) );
-    
+
                 changeSet.addFile( changeFile );
             }
         }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Wed Jul  1 21:27:25 2009
@@ -273,14 +273,7 @@
             @Override
             public void run()
             {
-                try
-                {
-                    stopContinuum();
-                }
-                catch ( StoppingException e )
-                {
-                    e.printStackTrace();
-                }
+                stopContinuum();
             }
         } );
     }
@@ -290,16 +283,6 @@
         return releaseManager;
     }
 
-    public void setActionManager( ActionManager actionManager )
-    {
-        this.actionManager = actionManager;
-    }
-
-    public ActionManager getActionManager()
-    {
-        return actionManager;
-    }
-
     public ContinuumPurgeManager getPurgeManager()
     {
         return purgeManager;
@@ -544,14 +527,18 @@
     // Projects
     // ----------------------------------------------------------------------
 
-    // TODO: Remove this method
+    /**
+     * TODO: Remove this method
+     */
     public Collection<Project> getProjects()
         throws ContinuumException
     {
         return projectDao.getAllProjectsByName();
     }
 
-    // TODO: Remove this method
+    /**
+     * TODO: Remove this method
+     */
     public Collection<Project> getProjectsWithDependencies()
         throws ContinuumException
     {
@@ -763,18 +750,15 @@
     // Building
     // ----------------------------------------------------------------------
 
+    /**
+     * TODO: Remove this method
+     */
     public void buildProjects()
         throws ContinuumException
     {
         buildProjects( ContinuumProjectState.TRIGGER_FORCED );
     }
 
-    public void buildProjectsWithBuildDefinition( int buildDefinitionId )
-        throws ContinuumException
-    {
-        buildProjects( ContinuumProjectState.TRIGGER_FORCED, buildDefinitionId );
-    }
-
     public void buildProjectsWithBuildDefinition( List<Project> projects, List<BuildDefinition> bds )
         throws ContinuumException
     {
@@ -793,6 +777,7 @@
 
     /**
      * fire of the builds of all projects across all project groups using their default build definitions
+     * TODO:Remove this method
      *
      * @param trigger
      * @throws ContinuumException
@@ -808,23 +793,6 @@
     }
 
     /**
-     * fire of the builds of all projects across all project groups using the group build definition
-     *
-     * @param trigger
-     * @param buildDefinitionId
-     * @throws ContinuumException
-     */
-    public void buildProjects( int trigger, int buildDefinitionId )
-        throws ContinuumException
-    {
-        Collection<Project> projectsList = getProjectsInBuildOrder();
-
-        Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projectsList );
-
-        prepareBuildProjects( filteredProjectsList, buildDefinitionId, trigger );
-    }
-
-    /**
      * fire off a build for all of the projects in a project group using their default builds
      *
      * @param projectGroupId
@@ -921,6 +889,8 @@
                 return;
             }
 
+            //TODO: As all projects are built in the same queue for a project group, it would be better to get them by
+            // project group and add them in queues in parallel to save few seconds
             projectsList = getProjectsInBuildOrder();
         }
         catch ( ContinuumStoreException e )
@@ -1111,7 +1081,6 @@
 
 
     private void removeBuildResult( BuildResult buildResult )
-        throws ContinuumException
     {
         buildResultDao.removeBuildResult( buildResult );
 
@@ -1129,7 +1098,7 @@
                 getConfiguration().getBuildOutputFile( buildResult.getId(), buildResult.getProject().getId() );
             if ( buildOutputFile.exists() )
             {
-                buildOutputFile.delete();
+                FileUtils.forceDelete( buildOutputFile );
             }
         }
         catch ( ConfigurationException e )
@@ -1156,12 +1125,24 @@
         }
     }
 
-    //TODO: Must be done by build definition
+    /**
+     * TODO: Must be done by build definition
+     */
     public List<ChangeSet> getChangesSinceLastSuccess( int projectId, int buildResultId )
         throws ContinuumException
     {
-        ArrayList<BuildResult> buildResults =
-            new ArrayList<BuildResult>( buildResultDao.getBuildResultsForProject( projectId, 0 ) );
+        BuildResult previousBuildResult = null;
+        try
+        {
+            previousBuildResult = buildResultDao.getPreviousBuildResultInSuccess( projectId, buildResultId );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            //No previous build in success, Nothing to do
+        }
+        long startTime = previousBuildResult == null ? 0 : previousBuildResult.getStartTime();
+        ArrayList<BuildResult> buildResults = new ArrayList<BuildResult>(
+            buildResultDao.getBuildResultsForProjectWithDetails( projectId, startTime, buildResultId ) );
 
         Collections.reverse( buildResults );
 
@@ -1169,6 +1150,7 @@
 
         boolean stop = false;
 
+        //TODO: Shouldn't be used now with the previous call of buildResultDao.getBuildResultsForProjectWithDetails
         while ( !stop )
         {
             if ( buildResultsIterator.hasNext() )
@@ -1229,7 +1211,9 @@
     //
     // ----------------------------------------------------------------------
 
-    //TODO: Remove this method when it won't be used
+    /**
+     * TODO: Remove this method when it won't be used
+     */
     private List<Project> getProjectsInBuildOrder()
         throws ContinuumException
     {
@@ -1781,13 +1765,13 @@
         return result;
     }
 
-    protected ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
-                                                                                     String projectBuilderId,
-                                                                                     int projectGroupId,
-                                                                                     boolean checkProtocol,
-                                                                                     boolean useCredentialsCache,
-                                                                                     boolean loadRecursiveProjects,
-                                                                                     int buildDefinitionTemplateId )
+    private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
+                                                                                   String projectBuilderId,
+                                                                                   int projectGroupId,
+                                                                                   boolean checkProtocol,
+                                                                                   boolean useCredentialsCache,
+                                                                                   boolean loadRecursiveProjects,
+                                                                                   int buildDefinitionTemplateId )
         throws ContinuumException
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, projectGroupId, checkProtocol,
@@ -2116,7 +2100,7 @@
         AbstractContinuumAction.setProjectId( context, projectId );
 
         executeAction( "add-build-definition-to-project", context );
-        
+
         activeBuildDefinitionSchedule( schedule );
 
         return AbstractContinuumAction.getBuildDefinition( context );
@@ -2127,7 +2111,6 @@
     {
         HashMap<String, Object> context = new HashMap<String, Object>();
         BuildDefinition buildDefinition = getBuildDefinition( buildDefinitionId );
-        Schedule schedule = buildDefinition.getSchedule();
 
         AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
         AbstractContinuumAction.setProjectId( context, projectId );
@@ -2145,7 +2128,7 @@
         AbstractContinuumAction.setProjectId( context, projectId );
 
         executeAction( "update-build-definition-from-project", context );
-        
+
         activeBuildDefinitionSchedule( schedule );
 
         return AbstractContinuumAction.getBuildDefinition( context );
@@ -2161,7 +2144,7 @@
         AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
 
         executeAction( "add-build-definition-to-project-group", context );
-        
+
         activeBuildDefinitionSchedule( schedule );
 
         return AbstractContinuumAction.getBuildDefinition( context );
@@ -2188,7 +2171,7 @@
         AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
 
         executeAction( "update-build-definition-from-project-group", context );
-        
+
         activeBuildDefinitionSchedule( schedule );
 
         return AbstractContinuumAction.getBuildDefinition( context );
@@ -2209,19 +2192,6 @@
         }
     }
 
-    public void removeBuildDefinition( BuildDefinition buildDefinition )
-        throws ContinuumException
-    {
-        try
-        {
-            buildDefinitionDao.removeBuildDefinition( buildDefinition );
-        }
-        catch ( ContinuumStoreException ex )
-        {
-            throw logAndCreateException( "Error while removing build definition.", ex );
-        }
-    }
-
     // ----------------------------------------------------------------------
     // Schedule
     // ----------------------------------------------------------------------
@@ -2291,9 +2261,9 @@
     private void updateSchedule( Schedule schedule, boolean updateScheduler )
         throws ContinuumException
     {
-        
+
         Schedule old = getSchedule( schedule.getId() );
-        
+
         storeSchedule( schedule );
 
         if ( updateScheduler )
@@ -2372,7 +2342,7 @@
         }
     }
 
-    public Schedule storeSchedule( Schedule schedule )
+    private Schedule storeSchedule( Schedule schedule )
         throws ContinuumException
     {
         try
@@ -2384,7 +2354,7 @@
             throw logAndCreateException( "Error while storing schedule.", ex );
         }
     }
-    
+
     public void activePurgeSchedule( Schedule schedule )
     {
         try
@@ -2396,7 +2366,7 @@
             log.error( "Can't activate schedule for purgeConfiguration" );
         }
     }
-    
+
     public void activeBuildDefinitionSchedule( Schedule schedule )
     {
         try
@@ -2699,9 +2669,9 @@
         }
     }
 
-    public void stopContinuum()
-        throws StoppingException
+    private void stopContinuum()
     {
+        //TODO: Remove all projects from queues, stop scheduler and wait the end of current builds so build results will be ok
         if ( stopped )
         {
             return;
@@ -2866,20 +2836,7 @@
         }
     }
 
-    public void removeNotifier( ProjectNotifier notifier )
-        throws ContinuumException
-    {
-        try
-        {
-            notifierDao.removeNotifier( notifier );
-        }
-        catch ( ContinuumStoreException ex )
-        {
-            throw logAndCreateException( "Error while removing notifier.", ex );
-        }
-    }
-
-    public ProjectNotifier storeNotifier( ProjectNotifier notifier )
+    private ProjectNotifier storeNotifier( ProjectNotifier notifier )
         throws ContinuumException
     {
         try
@@ -2892,7 +2849,7 @@
         }
     }
 
-    public String getWorkingDirectory()
+    private String getWorkingDirectory()
     {
         return configurationService.getWorkingDirectory().getAbsolutePath();
     }
@@ -2965,12 +2922,6 @@
         }
     }
 
-    public Collection<ProjectGroup> getAllProjectGroupsWithProjects()
-    {
-        //TODO: check why this interface isn't throwing exceptions on this guy
-        return projectGroupDao.getAllProjectGroupsWithProjects();
-    }
-
     public List<ProjectGroup> getAllProjectGroupsWithBuildDetails()
     {
         return projectGroupDao.getAllProjectGroupsWithBuildDetails();
@@ -3133,7 +3084,14 @@
 
             if ( releaseFile.exists() )
             {
-                releaseFile.delete();
+                try
+                {
+                    FileUtils.forceDelete( releaseFile );
+                }
+                catch ( IOException e )
+                {
+                    throw new ContinuumException( "Can't delete " + releaseFile.getAbsolutePath(), e );
+                }
             }
         }
         catch ( ConfigurationException e )
@@ -3708,8 +3666,6 @@
     private void checkForDuplicateProjectInGroup( ProjectGroup projectGroup, Project projectToCheck,
                                                   ContinuumProjectBuildingResult result )
     {
-        String duplicateProjects = "";
-
         List<Project> projectsInGroup = projectGroup.getProjects();
 
         if ( projectsInGroup == null )
@@ -3724,7 +3680,7 @@
                 project.getArtifactId().equals( projectToCheck.getArtifactId() ) &&
                 project.getVersion().equals( projectToCheck.getVersion() ) )
             {
-                result.addError( result.ERROR_DUPLICATE_PROJECTS );
+                result.addError( ContinuumProjectBuildingResult.ERROR_DUPLICATE_PROJECTS );
                 return;
             }
         }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java Wed Jul  1 21:27:25 2009
@@ -27,7 +27,6 @@
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ProjectDao;
-import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.continuum.dao.ProjectScmRootDao;
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.utils.ContinuumUtils;
@@ -624,10 +623,9 @@
 
                 if ( dependencyProject != null )
                 {
-                    List<BuildResult> buildResults =
-                        buildResultDao.getBuildResultsInSuccessForProject( dependencyProject.getId(),
-                                                                           context.getOldBuildResult().getEndTime() );
-                    if ( buildResults != null && !buildResults.isEmpty() )
+                    long nbBuild = buildResultDao.getNbBuildResultsInSuccessForProject( dependencyProject.getId(),
+                                                                                        context.getOldBuildResult().getEndTime() );
+                    if ( nbBuild > 0 )
                     {
                         log.debug( "Dependency changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
                             dep.getVersion() );

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java Wed Jul  1 21:27:25 2009
@@ -249,6 +249,8 @@
         Project project = context.getProject();
         List<ProjectNotifier> notifiers = context.getNotifiers();
         BuildResult build = context.getBuildResult();
+        log.error( "br state="+build.getState() );
+        log.error( "project state="+project.getState() );
         BuildDefinition buildDefinition = context.getBuildDefinition();
         ProjectScmRoot projectScmRoot = context.getProjectScmRoot();
 

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java Wed Jul  1 21:27:25 2009
@@ -247,7 +247,7 @@
     {
         Continuum continuum = (Continuum) lookup( Continuum.ROLE );
 
-        Collection projectGroupList = continuum.getAllProjectGroupsWithProjects();
+        Collection projectGroupList = continuum.getAllProjectGroups();
 
         int projectGroupsBefore = projectGroupList.size();
 
@@ -265,7 +265,7 @@
 
         assertEquals( "plexus", projectGroup.getGroupId() );
 
-        projectGroupList = continuum.getAllProjectGroupsWithProjects();
+        projectGroupList = continuum.getAllProjectGroups();
 
         assertEquals( "Project group missing, should have " + ( projectGroupsBefore + 1 ) + " project groups",
                       projectGroupsBefore + 1, projectGroupList.size() );
@@ -276,7 +276,7 @@
 
         BuildsManager buildsManager = continuum.getBuildsManager();
 
-        List<Project> projects = projectGroup.getProjects();
+        List<Project> projects = continuum.getProjectGroupWithProjects( projectGroup.getId() ).getProjects();
         int[] projectIds = new int[projects.size()];
 
         int idx = 0;
@@ -292,7 +292,7 @@
 
         continuum.removeProjectGroup( projectGroup.getId() );
 
-        projectGroupList = continuum.getAllProjectGroupsWithProjects();
+        projectGroupList = continuum.getAllProjectGroups();
 
         assertEquals( "Remove project group failed", projectGroupsBefore, projectGroupList.size() );
     }
@@ -305,7 +305,7 @@
     {
         Continuum continuum = (Continuum) lookup( Continuum.ROLE );
 
-        Collection projectGroupList = continuum.getAllProjectGroupsWithProjects();
+        Collection projectGroupList = continuum.getAllProjectGroups();
 
         int projectGroupsBefore = projectGroupList.size();
 

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java Wed Jul  1 21:27:25 2009
@@ -29,6 +29,8 @@
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMessage.RecipientType;
 
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.notification.mail.MockJavaMailSender;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -62,18 +64,39 @@
 
         ProjectGroup group = createStubProjectGroup( "foo.bar", "" );
 
+        BuildResultDao brDao = (BuildResultDao) lookup( BuildResultDao.class );
         Project project = addProject( "Test Project", group );
+        BuildResult br = makeBuild( ContinuumProjectState.FAILED );
+        brDao.addBuildResult( project, br );
+
+        br = makeBuild( ContinuumProjectState.OK );
+        brDao.addBuildResult( project, br );
+
+        br = makeBuild( ContinuumProjectState.FAILED );
+        brDao.addBuildResult( project, br );
 
         BuildResult build = makeBuild( ContinuumProjectState.OK );
+        assertEquals( ContinuumProjectState.OK, build.getState() );
+
+        project.setState( build.getState() );
+        getProjectDao().updateProject( project );
 
         BuildDefinition buildDef = new BuildDefinition();
         buildDef.setType( "maven2" );
         buildDef.setBuildFile( "pom.xml" );
         buildDef.setGoals( "clean install" );
         buildDef.setArguments( "" );
+        BuildDefinitionDao buildDefDao = (BuildDefinitionDao) lookup( BuildDefinitionDao.class );
+        buildDef = buildDefDao.addBuildDefinition( buildDef );
         build.setBuildDefinition( buildDef );
+        assertEquals( ContinuumProjectState.OK, build.getState() );
 
-        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "lots out build output", toOverride );
+        brDao.addBuildResult( project, build );
+        build = brDao.getLatestBuildResultForProjectWithDetails( project.getId() );
+        assertEquals( ContinuumProjectState.OK, build.getState() );
+
+        MimeMessage mailMessage =
+            sendNotificationAndGetMessage( project, build, buildDef, "lots out build output", toOverride );
 
         assertEquals( "[continuum] BUILD SUCCESSFUL: foo.bar Test Project", mailMessage.getSubject() );
 
@@ -92,7 +115,7 @@
 
         BuildResult build = makeBuild( ContinuumProjectState.FAILED );
 
-        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "output", null );
+        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, null, "output", null );
 
         assertEquals( "[continuum] BUILD FAILURE: foo.bar Test Project", mailMessage.getSubject() );
 
@@ -110,7 +133,7 @@
 
         build.setError( "Big long error message" );
 
-        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "lots of stack traces", null );
+        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, null, "lots of stack traces", null );
 
         assertEquals( "[continuum] BUILD ERROR: foo.bar Test Project", mailMessage.getSubject() );
 
@@ -151,8 +174,8 @@
     //
     // ----------------------------------------------------------------------
 
-    private MimeMessage sendNotificationAndGetMessage( Project project, BuildResult build, String buildOutput,
-                                                       String toOverride )
+    private MimeMessage sendNotificationAndGetMessage( Project project, BuildResult build, BuildDefinition buildDef,
+                                                       String buildOutput, String toOverride )
         throws Exception
     {
         MessageContext context = new MessageContext();
@@ -161,6 +184,8 @@
 
         context.setBuildResult( build );
 
+        context.setBuildDefinition( buildDef );
+
         ProjectNotifier projectNotifier = new ProjectNotifier();
         projectNotifier.setType( "mail" );
         Map<String, String> config = new HashMap<String, String>();
@@ -217,8 +242,6 @@
     {
         BuildResult build = new BuildResult();
 
-        build.setId( 17 );
-
         build.setStartTime( System.currentTimeMillis() );
 
         build.setEndTime( System.currentTimeMillis() + 1234567 );

Modified: continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java Wed Jul  1 21:27:25 2009
@@ -19,21 +19,21 @@
  * under the License.
  */
 
-import org.apache.maven.continuum.model.project.BuildResult;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.springframework.stereotype.Repository;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import javax.jdo.Extent;
 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
 import javax.jdo.Transaction;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.project.ContinuumProjectState;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.springframework.stereotype.Repository;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -153,6 +153,44 @@
         return null;
     }
 
+    public BuildResult getLatestBuildResultForProjectWithDetails( int projectId )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
+
+            Extent extent = pm.getExtent( BuildResult.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int projectId" );
+
+            query.setFilter( "this.project.id == projectId && this.project.latestBuildId == this.id" );
+
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
+
+            result = (List<BuildResult>) pm.detachCopyAll( result );
+
+            tx.commit();
+
+            if ( result != null && !result.isEmpty() )
+            {
+                return result.get( 0 );
+            }
+        }
+        finally
+        {
+            rollback( tx );
+        }
+        return null;
+    }
+
     public BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId )
     {
         PersistenceManager pm = getPersistenceManager();
@@ -184,7 +222,7 @@
 
             if ( result != null && !result.isEmpty() )
             {
-                return (BuildResult) result.get( 0 );
+                return result.get( 0 );
             }
         }
         finally
@@ -252,11 +290,6 @@
         return null;
     }
 
-    public Map<Integer, BuildResult> getLatestBuildResults()
-    {
-        return getLatestBuildResultsByProjectGroupId( -1 );
-    }
-
     public void removeBuildResult( BuildResult buildResult )
     {
         removeObject( buildResult );
@@ -279,9 +312,9 @@
 
             query.declareParameters( "Integer projectId" );
 
-            List result = (List) query.execute( projectId );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -317,9 +350,9 @@
 
             query.setFilter( "this.project.id == projectId && this.buildNumber == buildNumber" );
 
-            List result = (List) query.execute( projectId, buildNumber );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId, buildNumber );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -404,9 +437,93 @@
         }
     }
 
+    public long getNbBuildResultsInSuccessForProject( int projectId, long fromDate )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( BuildResult.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int projectId, long fromDate, int state" );
+
+            query.setFilter( "this.project.id == projectId && this.startTime > fromDate && this.state == state" );
+
+            query.setResult( "count(this)" );
+
+            long result = (Long) query.execute( projectId, fromDate, ContinuumProjectState.OK );
+
+            tx.commit();
+
+            return result;
+        }
+        finally
+        {
+            rollback( tx );
+        }
+    }
+
+    public List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, long fromDate, int tobuildResultId )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( BuildResult.class, true );
+            pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
+
+            Query query = pm.newQuery( extent );
+
+            String parameters = "int projectId, long fromDate";
+            String filter = "this.project.id == projectId && this.startTime > fromDate";
+
+            if ( tobuildResultId > 0 )
+            {
+                parameters += ", int buildResultId";
+                filter += " && this.id < buildResultId";
+            }
+            query.declareParameters( parameters );
+
+            query.setFilter( filter );
+
+            query.setOrdering( "this.id descending" );
+
+            List<BuildResult> result;
+
+            if ( tobuildResultId > 0 )
+            {
+                result = (List<BuildResult>) query.execute( projectId, fromDate, tobuildResultId );
+            }
+            else
+            {
+                result = (List<BuildResult>) query.execute( projectId, fromDate );
+            }
+
+            result = (List<BuildResult>) pm.detachCopyAll( result );
+
+            tx.commit();
+
+            return result;
+        }
+        finally
+        {
+            rollback( tx );
+        }
+    }
+
     public List<BuildResult> getBuildResultsForProject( int projectId )
     {
-        return getBuildResultsForProject( projectId, -1, -1 );
+        return getBuildResultsForProjectWithDetails( projectId, -1, -1 );
     }
 
     public List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex )
@@ -414,7 +531,7 @@
         PersistenceManager pm = getPersistenceManager();
 
         Transaction tx = pm.currentTransaction();
-        
+
         try
         {
             tx.begin();
@@ -434,9 +551,9 @@
                 query.setRange( startIndex, endIndex );
             }
 
-            List result = (List) query.execute( projectId );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -447,7 +564,7 @@
             rollback( tx );
         }
     }
-    
+
     public List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
         throws ContinuumStoreException
     {
@@ -456,7 +573,7 @@
         Transaction tx = pm.currentTransaction();
 
         pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
-        
+
         try
         {
             tx.begin();
@@ -466,14 +583,14 @@
             Query query = pm.newQuery( extent );
 
             query.declareParameters( "int projectId, int buildNumber" );
-           
+
             query.setFilter( "this.project.id == projectId && this.buildNumber >= buildNumber" );
-            
+
             query.setOrdering( "this.startTime descending" );
 
-            List result = (List) query.execute( projectId, startId );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId, startId );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -489,14 +606,12 @@
         }
     }
 
-    public List<BuildResult> getBuildResultsForProject( int projectId, long fromDate )
+    public BuildResult getLatestBuildResultInSuccess( int projectId )
     {
         PersistenceManager pm = getPersistenceManager();
 
         Transaction tx = pm.currentTransaction();
 
-        pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
-
         try
         {
             tx.begin();
@@ -505,13 +620,17 @@
 
             Query query = pm.newQuery( extent );
 
-            query.declareParameters( "int projectId, long fromDate" );
+            query.declareParameters( "int projectId" );
+
+            String filter = "this.project.buildNumber == this.buildNumber && this.project.id == projectId";
+
+            query.setFilter( filter );
 
-            query.setFilter( "this.project.id == projectId && this.startTime > fromDate" );
+            query.setUnique( true );
 
-            List result = (List) query.execute( projectId, fromDate );
+            BuildResult result = (BuildResult) query.execute( projectId );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (BuildResult) pm.detachCopy( result );
 
             tx.commit();
 
@@ -523,23 +642,52 @@
         }
     }
 
-    public List<BuildResult> getBuildResultsInSuccessForProject( int projectId, long fromDate )
+    private int getPreviousBuildResultIdInSuccess( int projectId, int buildResultId )
     {
-        List<BuildResult> buildResults = getBuildResultsForProject( projectId, fromDate );
+        PersistenceManager pm = getPersistenceManager();
 
-        List<BuildResult> results = new ArrayList<BuildResult>();
+        Transaction tx = pm.currentTransaction();
 
-        if ( buildResults != null )
+        try
         {
-            for ( BuildResult res : buildResults )
-            {
-                if ( res.getState() == ContinuumProjectState.OK )
-                {
-                    results.add( res );
-                }
-            }
+            tx.begin();
+
+            Extent extent = pm.getExtent( BuildResult.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int projectId, int buildResultId" );
+
+            String filter = "this.id < buildResultId && this.state == " + ContinuumProjectState.OK +
+                "  && this.project.id == projectId";
+
+            query.setFilter( filter );
+
+            query.setResult( "max(this.id)" );
+
+            int result = (Integer) query.execute( projectId, buildResultId );
+
+            tx.commit();
+
+            return result;
+        }
+        finally
+        {
+            rollback( tx );
+        }
+    }
+
+    public BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId )
+        throws ContinuumStoreException
+    {
+        try
+        {
+            return getBuildResult( getPreviousBuildResultIdInSuccess( projectId, buildResultId ) );
+        }
+        catch ( NullPointerException e )
+        {
+            return null;
         }
-        return results;
     }
 
     public Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId )
@@ -600,10 +748,4 @@
 
         return null;
     }
-
-    public Map<Integer, BuildResult> getBuildResultsInSuccess()
-    {
-        return getBuildResultsInSuccessByProjectGroupId( -1 );
-    }
-
 }

Modified: continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java Wed Jul  1 21:27:25 2009
@@ -119,10 +119,6 @@
                 {
                     pmf.close();
                 }
-                catch ( SecurityException e )
-                {
-                    throw e;
-                }
                 catch ( JDOUserException e )
                 {
                     if ( numTry < 5 )
@@ -176,9 +172,8 @@
         // might define their own build definitions
         if ( projectGroupSource != null )
         {
-            for ( Iterator i = projectGroupSource.keySet().iterator(); i.hasNext(); )
+            for ( Integer projectGroupId : projectGroupSource.keySet() )
             {
-                Integer projectGroupId = (Integer) i.next();
                 List<Project> projectsInGroup = projectDao.getProjectsInGroup( projectGroupId );
 
                 for ( Project p : projectsInGroup )

Modified: continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java Wed Jul  1 21:27:25 2009
@@ -19,20 +19,20 @@
  * under the License.
  */
 
-import org.apache.maven.continuum.model.system.Installation;
-import org.apache.maven.continuum.model.system.Profile;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.codehaus.plexus.util.StringUtils;
-import org.springframework.stereotype.Repository;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
 
 import javax.jdo.Extent;
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
 import javax.jdo.Transaction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
+
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.codehaus.plexus.util.StringUtils;
+import org.springframework.stereotype.Repository;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -85,9 +85,8 @@
 
             if ( result.size() != 0 )
             {
-                for ( Iterator<Profile> iterator = result.iterator(); iterator.hasNext(); )
+                for ( Profile profile : result )
                 {
-                    Profile profile = iterator.next();
                     profile.setJdk( null );
                     pm.makePersistent( profile );
                 }
@@ -106,9 +105,8 @@
 
             if ( result.size() != 0 )
             {
-                for ( Iterator<Profile> iterator = result.iterator(); iterator.hasNext(); )
+                for ( Profile profile : result )
                 {
-                    Profile profile = iterator.next();
                     profile.setBuilder( null );
                     pm.makePersistent( profile );
                 }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java?rev=790386&r1=790385&r2=790386&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java Wed Jul  1 21:27:25 2009
@@ -76,7 +76,8 @@
             }
             else
             {
-                //TODO: Check if it is called somewhere
+                //TODO: Check if this code is called, I don't think
+                //If it is, it should used the projectId
                 getContinuum().buildProjects();
             }
         }



Mime
View raw message