airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject [31/50] [abbrv] airavata git commit: Fixed NPE with experiment cancellation
Date Fri, 26 Aug 2016 15:43:26 GMT
Fixed NPE with experiment cancellation


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b284167d
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b284167d
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b284167d

Branch: refs/heads/lahiru/AIRAVATA-2057
Commit: b284167d29172e28cff71575d82731a124ce4c4d
Parents: 309a9ff
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Tue Aug 16 16:25:29 2016 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Tue Aug 16 16:25:29 2016 -0400

----------------------------------------------------------------------
 .../airavata/api/server/handler/AiravataServerHandler.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b284167d/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index e489b43..b21be18 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -1454,16 +1454,15 @@ public class AiravataServerHandler implements Airavata.Iface {
                 logger.error(airavataExperimentId, "Error while cancelling experiment {},
experiment doesn't exist.", airavataExperimentId);
                 throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId
+ " does not exist in the system..");
             }
-            ExperimentStatus experimentStatus = null;
-            switch (experimentStatus.getState()) {
+            switch (existingExperiment.getExperimentStatus().getState()) {
                 case COMPLETED: case CANCELED: case FAILED: case CANCELING:
-                    logger.warn("Can't terminate already {} experiment", experimentStatus.getState().name());
+                    logger.warn("Can't terminate already {} experiment", existingExperiment.getExperimentStatus().getState().name());
                     break;
                 case CREATED:
                     logger.warn("Experiment termination is only allowed for launched experiments.");
                     break;
                 default:
-                    submitCancelExperiment(airavataExperimentId, gatewayId);
+                    submitCancelExperiment(gatewayId, airavataExperimentId);
                     logger.debug("Airavata cancelled experiment with experiment id : " +
airavataExperimentId);
                     break;
             }


Mime
View raw message