continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r897779 - /continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Mon, 11 Jan 2010 07:44:05 GMT
Author: ctan
Date: Mon Jan 11 07:44:05 2010
New Revision: 897779

URL: http://svn.apache.org/viewvc?rev=897779&view=rev
Log:
[CONTINUUM-2411] added check and break up the codes

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

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=897779&r1=897778&r2=897779&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
Mon Jan 11 07:44:05 2010
@@ -1725,17 +1725,29 @@
                 AbstractContinuumAction.setProject( context, projectDao.getProject( project.getId()
) );
 
                 BuildDefinition defaultBuildDefinition = null;
+                BuildDefinitionTemplate template = null;
                 if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
                 {
-                    defaultBuildDefinition =
-                        (BuildDefinition) buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getBuildDefinitions().get(
-                            0 );
+                    template = buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate();
+
+                    if( template != null && template.getBuildDefinitions().size()
> 0 )
+                    {
+                        defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
+                    }
                 }
                 else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
                 {
-                    defaultBuildDefinition =
-                        (BuildDefinition) buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate().getBuildDefinitions().get(
-                            0 );
+                    template = buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate();
+
+                    if ( template != null && template.getBuildDefinitions().size()
> 0 )
+                    {
+                        defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
+                    }
+                }
+
+                if ( defaultBuildDefinition == null )
+                {
+                    throw new ContinuumException( "Error adding projects from modules because
no default build definition defined in the default template" );
                 }
 
                 // used by BuildManager to determine on which build queue will the project
be put



Mime
View raw message