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-2452: Sqoop2: Findbugs: Convert anonymous class in ResourceRequest to static inner class
Date Thu, 30 Jul 2015 01:47:52 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 51fe7a9bc -> 3c88f553d


SQOOP-2452: Sqoop2: Findbugs: Convert anonymous class in ResourceRequest to static inner class

(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/3c88f553
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/3c88f553
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/3c88f553

Branch: refs/heads/sqoop2
Commit: 3c88f553de57a6fc35bc4e2191bcb58384662d72
Parents: 51fe7a9
Author: Abraham Elmahrek <abe@apache.org>
Authored: Wed Jul 29 18:47:09 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Wed Jul 29 18:47:09 2015 -0700

----------------------------------------------------------------------
 .../apache/sqoop/client/request/ResourceRequest.java | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/3c88f553/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java b/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
index a8a7e89..e7f49f4 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
@@ -183,6 +183,13 @@ public class ResourceRequest {
     return doHttpRequest(url, HttpMethod.DELETE);
   }
 
+  private static class SimpleConnectionConfigurator implements ConnectionConfigurator {
+    @Override
+    public HttpURLConnection configure(HttpURLConnection conn) throws IOException {
+      return conn;
+    }
+  }
+
   public Token<?>[] addDelegationTokens(String strURL, String renewer,
                                         Credentials credentials) throws IOException {
     Token<?>[] tokens = null;
@@ -190,13 +197,7 @@ public class ResourceRequest {
     Token<?> token = credentials.getToken(dtService);
     if (token == null) {
       URL url = new URL(strURL);
-      DelegationTokenAuthenticatedURL authUrl =
-              new DelegationTokenAuthenticatedURL(new ConnectionConfigurator() {
-                @Override
-                public HttpURLConnection configure(HttpURLConnection conn) throws IOException
{
-                  return conn;
-                }
-              });
+      DelegationTokenAuthenticatedURL authUrl = new DelegationTokenAuthenticatedURL(new SimpleConnectionConfigurator());
       try {
         token = authUrl.getDelegationToken(url, authToken, renewer);
         if (token != null) {


Mime
View raw message