sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1668: Update existing job meets NPE
Date Tue, 04 Nov 2014 18:01:41 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 93d6f2f88 -> 63ebb11d3


SQOOP-1668: Update existing job meets NPE

(Qian Xu via Jarek Jarcec Cecho)


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

Branch: refs/heads/sqoop2
Commit: 63ebb11d3afdac3fd3495b65293e4ea0949201f7
Parents: 93d6f2f
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Nov 4 10:01:12 2014 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Nov 4 10:01:12 2014 -0800

----------------------------------------------------------------------
 .../apache/sqoop/handler/JobRequestHandler.java | 23 ++++++++++----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/63ebb11d/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
index 8130805..6e3983e 100644
--- a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
@@ -102,18 +102,19 @@ public class JobRequestHandler implements RequestHandler {
       return createUpdateJob(ctx, true);
     case PUT:
       JobAction action = JobAction.fromString(ctx.getLastURLElement());
-      switch (action) {
-      case ENABLE:
-        return enableJob(ctx, true);
-      case DISABLE:
-        return enableJob(ctx, false);
-      case START:
-        return startJob(ctx);
-      case STOP:
-        return stopJob(ctx);
-      default:
-        return createUpdateJob(ctx, false);
+      if (action != null) {
+        switch (action) {
+          case ENABLE:
+            return enableJob(ctx, true);
+          case DISABLE:
+            return enableJob(ctx, false);
+          case START:
+            return startJob(ctx);
+          case STOP:
+            return stopJob(ctx);
+        }
       }
+      return createUpdateJob(ctx, false);
     case DELETE:
       return deleteJob(ctx);
     }


Mime
View raw message