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/02/23 20:58:32 UTC

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

Author: heshan
Date: Thu Feb 23 19:58:31 2012
New Revision: 1292930

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

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=1292930&r1=1292929&r2=1292930&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 Thu Feb 23 19:58:31 2012
@@ -28,34 +28,38 @@ public class MigrationUtil {
 
         org.ogce.schemas.gfac.documents.InputParameterType[] inputParameterTypes = serviceBean.getInputParam();
         List<InputParameterType> inputList = new ArrayList<InputParameterType>();
-        for (org.ogce.schemas.gfac.documents.InputParameterType inputParameterType : inputParameterTypes) {
-            InputParameterType input = InputParameterType.Factory.newInstance();
-            String inputParamName = inputParameterType.getParameterName();
-            input.setParameterName(inputParamName);
-
-            //TODO
-            org.ogce.schemas.gfac.documents.InputDataType.Enum en = inputParameterType.getParameterType();
-            input.setParameterType(StringParameterType.Factory.newInstance());
-            inputList.add(input);
+        if (inputParameterTypes != null) {
+            for (org.ogce.schemas.gfac.documents.InputParameterType inputParameterType : inputParameterTypes) {
+                InputParameterType input = InputParameterType.Factory.newInstance();
+                String inputParamName = inputParameterType.getParameterName();
+                input.setParameterName(inputParamName);
+
+                //TODO
+                org.ogce.schemas.gfac.documents.InputDataType.Enum en = inputParameterType.getParameterType();
+                input.setParameterType(StringParameterType.Factory.newInstance());
+                inputList.add(input);
+            }
+            InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]);
+            serv.getType().setInputParametersArray(inputParamList);
         }
-        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]);
-        serv.getType().setInputParametersArray(inputParamList);
 
         org.ogce.schemas.gfac.documents.OutputParameterType[] outputParameterTypes = serviceBean.getOutputParam();
         List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
-        for (org.ogce.schemas.gfac.documents.OutputParameterType outputParameterType : outputParameterTypes) {
-            String outputParamName = outputParameterType.getParameterName();
-            OutputParameterType output = OutputParameterType.Factory.newInstance();
-            output.setParameterName(outputParamName);
-
-            //TODO
-            org.ogce.schemas.gfac.documents.OutputDataType.Enum en = outputParameterType.getParameterType();
-            output.setParameterType(StringParameterType.Factory.newInstance());
-            outputList.add(output);
-
+        if (outputParameterTypes != null){
+            for (org.ogce.schemas.gfac.documents.OutputParameterType outputParameterType : outputParameterTypes) {
+                String outputParamName = outputParameterType.getParameterName();
+                OutputParameterType output = OutputParameterType.Factory.newInstance();
+                output.setParameterName(outputParamName);
+
+                //TODO
+                org.ogce.schemas.gfac.documents.OutputDataType.Enum en = outputParameterType.getParameterType();
+                output.setParameterType(StringParameterType.Factory.newInstance());
+                outputList.add(output);
+
+            }
+            OutputParameterType[] outputParamList = outputList.toArray(new OutputParameterType[outputList.size()]);
+            serv.getType().setOutputParametersArray(outputParamList);
         }
-        OutputParameterType[] outputParamList = outputList.toArray(new OutputParameterType[outputList.size()]);
-        serv.getType().setOutputParametersArray(outputParamList);
 
         return serv;
     }