continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r765981 - /continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
Date Fri, 17 Apr 2009 13:10:25 GMT
Author: ctan
Date: Fri Apr 17 13:10:25 2009
New Revision: 765981

URL: http://svn.apache.org/viewvc?rev=765981&view=rev
Log:
[CONTINUUM-2179] prevent NPE when updating project from working copy on build agents

Modified:
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java?rev=765981&r1=765980&r2=765981&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
Fri Apr 17 13:10:25 2009
@@ -320,9 +320,30 @@
         Map<String, Object> projectMap = new HashMap<String, Object>();
 
         projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, project.getId() );
-        projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_VERSION, project.getVersion()
);
-        projectMap.put( ContinuumBuildAgentUtil.KEY_ARTIFACT_ID, project.getArtifactId()
);
-        projectMap.put( ContinuumBuildAgentUtil.KEY_GROUP_ID, project.getGroupId() );
+        if ( StringUtils.isNotEmpty( project.getVersion() ) )
+        {
+            projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_VERSION, project.getVersion()
);
+        }
+        else
+        {
+            projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_VERSION, "" );
+        }
+        if ( StringUtils.isNotEmpty( project.getArtifactId() ) )
+        {
+            projectMap.put( ContinuumBuildAgentUtil.KEY_ARTIFACT_ID, project.getArtifactId()
);
+        }
+        else
+        {
+            projectMap.put( ContinuumBuildAgentUtil.KEY_ARTIFACT_ID, "" );
+        }
+        if ( StringUtils.isNotEmpty( project.getGroupId() ) )
+        {
+            projectMap.put( ContinuumBuildAgentUtil.KEY_GROUP_ID, project.getGroupId() );
+        }
+        else
+        {
+            projectMap.put( ContinuumBuildAgentUtil.KEY_GROUP_ID, "" );
+        }
         if ( StringUtils.isNotEmpty( project.getName() ) )
         {
             projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_NAME, project.getName() );
@@ -390,8 +411,22 @@
             {
                 Map<String, String> map = new HashMap<String, String>();
                 map.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPER_NAME, developer.getName()
);
-                map.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPER_EMAIL, developer.getEmail()
);
-                map.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPER_SCMID, developer.getScmId()
);
+                if ( StringUtils.isNotEmpty( developer.getEmail() ) )
+                {
+                	map.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPER_EMAIL, developer.getEmail()
);
+                }
+                else
+                {
+                	map.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPER_EMAIL, "" );
+                }
+                if ( StringUtils.isNotEmpty( developer.getScmId() ) )
+                {
+                	map.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPER_SCMID, developer.getScmId()
);
+                }
+                else
+                {
+                    map.put( ContinuumBuildAgentUtil.KEY_PROJECT_DEVELOPER_SCMID, "" );
+                }
 
                 pDevelopers.add( map );
             }
@@ -405,9 +440,30 @@
 
         if ( parent != null )
         {
-            map.put( ContinuumBuildAgentUtil.KEY_GROUP_ID, parent.getGroupId() );
-            map.put( ContinuumBuildAgentUtil.KEY_ARTIFACT_ID, parent.getArtifactId() );
-            map.put( ContinuumBuildAgentUtil.KEY_PROJECT_VERSION, parent.getVersion() );
+            if ( StringUtils.isNotEmpty( parent.getGroupId() ) )
+            {
+                map.put( ContinuumBuildAgentUtil.KEY_GROUP_ID, parent.getGroupId() );
+            }
+            else
+            {
+                map.put( ContinuumBuildAgentUtil.KEY_GROUP_ID, "" );
+            }
+            if ( StringUtils.isNotEmpty( parent.getArtifactId() ) )
+            {
+                map.put( ContinuumBuildAgentUtil.KEY_ARTIFACT_ID, parent.getArtifactId()
);
+            }
+            else
+            {
+                map.put( ContinuumBuildAgentUtil.KEY_ARTIFACT_ID, "" );
+            }
+            if ( StringUtils.isNotEmpty( parent.getVersion() ) )
+            {
+                map.put( ContinuumBuildAgentUtil.KEY_PROJECT_VERSION, parent.getVersion()
);
+            }
+            else
+            {
+                map.put( ContinuumBuildAgentUtil.KEY_PROJECT_VERSION, "" );
+            }
         }
         return map;
     }
@@ -455,7 +511,7 @@
                 }
                 else
                 {
-
+                    map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_CONFIGURATION, "" );
                 }
                 if ( StringUtils.isNotBlank( notifier.getType() ) )
                 {



Mime
View raw message