continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r443440 - /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Thu, 14 Sep 2006 18:57:16 GMT
Author: carlos
Date: Thu Sep 14 11:57:15 2006
New Revision: 443440

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

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

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=443440&r1=443439&r2=443440
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Thu Sep 14 11:57:15 2006
@@ -564,47 +564,35 @@
                 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( groupBuildDefinitionIds, project );
 
                 // iterate through the project build definitions and build
                 List buildDefIds = projectsMap == null ? null : (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
+                if ( buildDefIds == null || buildDefIds.isEmpty() )
                 {
                     getLogger().info( "No build definitions, not building for project " +
project );
+                }
+            }
+        }
+    }
+
+    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() ) )
+                {
+                    buildProject( project, buildDefId.intValue(), ContinuumProjectState.TRIGGER_SCHEDULED,
false );
                 }
             }
         }



Mime
View raw message