sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-1784: Sqoop2: Sending POST request to link or job end-point might end up with NPE
Date Mon, 24 Nov 2014 05:40:12 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 ae9c6e354 -> bb25b8312


SQOOP-1784: Sqoop2: Sending POST request to link or job end-point might end up with NPE

(Jarek Jarcec Cecho via Abraham Elmahrek)


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

Branch: refs/heads/sqoop2
Commit: bb25b8312c183c44b7d771726803093bf22f71e4
Parents: ae9c6e3
Author: Abraham Elmahrek <abraham@elmahrek.com>
Authored: Sun Nov 23 21:38:34 2014 -0800
Committer: Abraham Elmahrek <abraham@elmahrek.com>
Committed: Sun Nov 23 21:39:45 2014 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/sqoop/handler/JobRequestHandler.java | 3 ++-
 .../main/java/org/apache/sqoop/handler/LinkRequestHandler.java    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/bb25b831/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 6e3983e..75a069a 100644
--- a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
@@ -153,7 +153,6 @@ public class JobRequestHandler implements RequestHandler {
 
     Repository repository = RepositoryManager.getInstance().getRepository();
 
-    String username = ctx.getUserName();
     JobBean bean = new JobBean();
 
     try {
@@ -163,6 +162,8 @@ public class JobRequestHandler implements RequestHandler {
       throw new SqoopException(ServerError.SERVER_0003, "Can't read request content", e);
     }
 
+    String username = ctx.getUserName();
+
     // Get job object
     List<MJob> jobs = bean.getJobs();
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/bb25b831/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
index 9a81832..d2d080b 100644
--- a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
@@ -108,7 +108,6 @@ public class LinkRequestHandler implements RequestHandler {
 
     Repository repository = RepositoryManager.getInstance().getRepository();
 
-    String username = ctx.getUserName();
     LinkBean linkBean = new LinkBean();
     try {
       JSONObject postData = (JSONObject) JSONValue.parse(ctx.getRequest().getReader());
@@ -117,6 +116,8 @@ public class LinkRequestHandler implements RequestHandler {
       throw new SqoopException(ServerError.SERVER_0003, "Can't read request content", e);
     }
 
+    String username = ctx.getUserName();
+
     // Get link object
     List<MLink> links = linkBean.getLinks();
     if (links.size() != 1) {


Mime
View raw message