You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by he...@apache.org on 2012/03/09 16:23:36 UTC

svn commit: r1298869 - /incubator/airavata/trunk/modules/registry-migrator/src/main/java/org/apache/airavata/migrator/registry/MigrationUtil.java

Author: heshan
Date: Fri Mar  9 15:23:35 2012
New Revision: 1298869

URL: http://svn.apache.org/viewvc?rev=1298869&view=rev
Log:
Fixing NPEs.

Modified:
    incubator/airavata/trunk/modules/registry-migrator/src/main/java/org/apache/airavata/migrator/registry/MigrationUtil.java

Modified: incubator/airavata/trunk/modules/registry-migrator/src/main/java/org/apache/airavata/migrator/registry/MigrationUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry-migrator/src/main/java/org/apache/airavata/migrator/registry/MigrationUtil.java?rev=1298869&r1=1298868&r2=1298869&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry-migrator/src/main/java/org/apache/airavata/migrator/registry/MigrationUtil.java (original)
+++ incubator/airavata/trunk/modules/registry-migrator/src/main/java/org/apache/airavata/migrator/registry/MigrationUtil.java Fri Mar  9 15:23:35 2012
@@ -218,8 +218,12 @@ public class MigrationUtil {
             gram.setScratchWorkingDirectory(appBean.getTmpDir());
             //TODO: add to documentation --> ask user to check the hostcount
             gram.setMaxWallTime(appBean.getMaxWallTime());
-            gram.setCpuCount(appBean.getPcount());
-            gram.setMinMemory(appBean.getMinMemory());
+            if (appBean.getPcount() != null) {
+                gram.setCpuCount(appBean.getPcount());
+            }
+            if (appBean.getMinMemory() != null) {
+                gram.setMinMemory(appBean.getMinMemory());
+            }
 
             gram.setJobType(getJobTypeEnum(appBean.getJobType()));
             // TODO : verify the following
@@ -278,8 +282,12 @@ public class MigrationUtil {
             gram.setScratchWorkingDirectory(appBean.getTmpDir());
             //TODO: add to documentation --> ask user to check the hostcount
             gram.setMaxWallTime(appBean.getMaxWallTime());
-            gram.setCpuCount(appBean.getPcount());
-            gram.setMinMemory(appBean.getMinMemory());
+            if (appBean.getPcount() != null) {
+                gram.setCpuCount(appBean.getPcount());
+            }
+            if (appBean.getMinMemory() != null) {
+                gram.setMinMemory(appBean.getMinMemory());
+            }
 
             gram.setJobType(getJobTypeEnum(appBean.getJobType()));
             // TODO : verify the following