continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r441753 - /maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Sat, 09 Sep 2006 07:46:03 GMT
Author: carlos
Date: Sat Sep  9 00:46:03 2006
New Revision: 441753

URL: http://svn.apache.org/viewvc?view=rev&rev=441753
Log:
Remove duplication

Modified:
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=441753&r1=441752&r2=441753
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Sat Sep  9 00:46:03 2006
@@ -588,56 +588,42 @@
 
             getLogger().info( "Building " + projectsList.size() + " projects" );
 
-            List groupBuildDefinitionIds = (List) projectGroupsMap.get( new Integer( projectGroup.getId()
) );
+            List buildDefinitionIds = (List) projectGroupsMap.get( new Integer( projectGroup.getId()
) );
 
             for ( Iterator j = projectsList.iterator(); j.hasNext(); )
             {
                 Project project = (Project) j.next();
 
                 // iterate through the project group build definitions and build
-                if ( groupBuildDefinitionIds != null && !groupBuildDefinitionIds.isEmpty()
)
-                {
-                    getLogger().info(
-                        "Processing " + groupBuildDefinitionIds.size() + " build definitions
for project " + project );
-                    for ( Iterator buildDefinitionIterator = groupBuildDefinitionIds.iterator();
-                          buildDefinitionIterator.hasNext(); )
-                    {
-                        Integer buildDefId = (Integer) buildDefinitionIterator.next();
-
-                        if ( buildDefId != null && !isInBuildingQueue( project.getId(),
buildDefId.intValue() ) &&
-                            !isInCheckoutQueue( project.getId() ) )
-                        {
-                            buildProject( project, buildDefId.intValue(), ContinuumProjectState.TRIGGER_SCHEDULED,
-                                          false );
-                        }
-                    }
-                }
+                buildFromDefinitionIds( buildDefinitionIds, project );
 
                 // iterate through the project build definitions and build
                 List buildDefIds = (List) projectsMap.get( new Integer( project.getId() )
);
 
-                if ( buildDefIds != null && !buildDefIds.isEmpty() )
-                {
-                    getLogger().info(
-                        "Processing " + buildDefIds.size() + " build definitions for project
" + project );
-                    for ( Iterator buildDefinitionIterator = buildDefIds.iterator();
-                          buildDefinitionIterator.hasNext(); )
-                    {
-                        Integer buildDefId = (Integer) buildDefinitionIterator.next();
+                buildFromDefinitionIds( buildDefIds, project );
+            }
+        }
+    }
 
-                        if ( buildDefId != null && !isInBuildingQueue( project.getId(),
buildDefId.intValue() ) &&
-                            !isInCheckoutQueue( project.getId() ) )
-                        {
-                            buildProject( project, buildDefId.intValue(), ContinuumProjectState.TRIGGER_SCHEDULED,
-                                          false );
-                        }
-                    }
-                }
-                else
+    private void buildFromDefinitionIds( Collection buildDefinitionIds, Project project )
+        throws ContinuumException
+    {
+        if ( buildDefinitionIds != null && !buildDefinitionIds.isEmpty() )
+        {
+            getLogger().info( "Processing " + buildDefinitionIds.size() + " build definitions
for project " + project );
+            for ( Iterator buildDefinitionIterator = buildDefinitionIds.iterator(); buildDefinitionIterator.hasNext();
)
+            {
+                Integer buildDefId = (Integer) buildDefinitionIterator.next();
+                if ( buildDefId != null && !isInBuildingQueue( project.getId(), buildDefId.intValue()
)
+                    && !isInCheckoutQueue( project.getId() ) )
                 {
-                    getLogger().info( "No build definitions, not building for project " +
project );
+                    buildProject( project, buildDefId.intValue(), ContinuumProjectState.TRIGGER_SCHEDULED,
false );
                 }
             }
+        }
+        else
+        {
+            getLogger().info( "No build definitions, not building for project " + project
);
         }
     }
 



Mime
View raw message