continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r793465 - in /continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum: buildcontroller/DefaultBuildController.java execution/maven/m2/MavenTwoBuildExecutor.java
Date Mon, 13 Jul 2009 06:00:05 GMT
Author: ctan
Date: Mon Jul 13 06:00:05 2009
New Revision: 793465

URL: http://svn.apache.org/viewvc?rev=793465&view=rev
Log:
[CONTINUUM-2295] prevent NPE when scmResult is null or scmResult.changes is null

Modified:
    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/execution/maven/m2/MavenTwoBuildExecutor.java

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=793465&r1=793464&r2=793465&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
Mon Jul 13 06:00:05 2009
@@ -512,9 +512,13 @@
             try
             {
                 ContinuumBuildExecutor executor = buildExecutorManager.getBuildExecutor(
project.getExecutorId() );
-                shouldBuild = executor.shouldBuild( context.getScmResult().getChanges(),
project,
-                                                    workingDirectoryService.getWorkingDirectory(
project ),
-                                                    context.getBuildDefinition() );
+
+                if ( context.getScmResult() != null )
+                {
+                    shouldBuild = executor.shouldBuild( context.getScmResult().getChanges(),
project,
+                                                        workingDirectoryService.getWorkingDirectory(
project ),
+                                                        context.getBuildDefinition() );
+                }
             }
             catch ( Exception e )
             {

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=793465&r1=793464&r2=793465&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Mon Jul 13 06:00:05 2009
@@ -395,10 +395,10 @@
         //Check if it's a recursive build
         boolean isRecursive = false;
         if (StringUtils.isNotEmpty( buildDefinition.getArguments() ) )
-            {
+        {
             isRecursive =  buildDefinition.getArguments().indexOf( "-N" ) < 0 &&
                 buildDefinition.getArguments().indexOf( "--non-recursive" ) < 0 ;
-            }
+        }
         if ( isRecursive && changes != null && !changes.isEmpty() )
         {
             if ( log.isInfoEnabled() )
@@ -410,7 +410,7 @@
 
         MavenProject project = getMavenProject( continuumProject, workingDirectory, buildDefinition
);
 
-        if ( changes.isEmpty() )
+        if ( changes == null || changes.isEmpty() )
         {
             if ( log.isInfoEnabled() )
             {



Mime
View raw message