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-2225: Sqoop2: Shell client clobbers server exceptions
Date Fri, 20 Mar 2015 01:28:35 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 7a2285c3c -> b055d4eba


SQOOP-2225: Sqoop2: Shell client clobbers server exceptions

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

Branch: refs/heads/sqoop2
Commit: b055d4eba8246545e1a7e3fb3018c45b6cbe0d61
Parents: 7a2285c
Author: Abraham Elmahrek <abe@apache.org>
Authored: Thu Mar 19 18:27:29 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Thu Mar 19 18:27:29 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/sqoop/utils/ClassUtils.java |  2 --
 .../test/java/org/apache/sqoop/utils/TestClassUtils.java |  2 +-
 .../org/apache/sqoop/connector/ConnectorHandler.java     | 11 ++++-------
 3 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/b055d4eb/common/src/main/java/org/apache/sqoop/utils/ClassUtils.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/utils/ClassUtils.java b/common/src/main/java/org/apache/sqoop/utils/ClassUtils.java
index 2c8d230..523dd19 100644
--- a/common/src/main/java/org/apache/sqoop/utils/ClassUtils.java
+++ b/common/src/main/java/org/apache/sqoop/utils/ClassUtils.java
@@ -61,8 +61,6 @@ public final class ClassUtils {
           klass = ctxLoader.loadClass(className);
         } catch (ClassNotFoundException ex) {
           LOG.debug("Exception while load class: " + className, ex);
-          // wrapping it in runtime, to avoid chainging the signature of methods currently
invoking this method
-          throw new RuntimeException(ex);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/b055d4eb/common/src/test/java/org/apache/sqoop/utils/TestClassUtils.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/sqoop/utils/TestClassUtils.java b/common/src/test/java/org/apache/sqoop/utils/TestClassUtils.java
index 58a27ba..161a1fa 100644
--- a/common/src/test/java/org/apache/sqoop/utils/TestClassUtils.java
+++ b/common/src/test/java/org/apache/sqoop/utils/TestClassUtils.java
@@ -29,7 +29,7 @@ import static org.testng.Assert.assertNull;
  */
 public class TestClassUtils {
 
-  @Test(expectedExceptions = Exception.class)
+  @Test
   public void testLoadClass() {
     assertNull(ClassUtils.loadClass("A"));
     assertEquals(A.class, ClassUtils.loadClass(A.class.getName()));

http://git-wip-us.apache.org/repos/asf/sqoop/blob/b055d4eb/core/src/main/java/org/apache/sqoop/connector/ConnectorHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/sqoop/connector/ConnectorHandler.java b/core/src/main/java/org/apache/sqoop/connector/ConnectorHandler.java
index 716a5b1..4df7782 100644
--- a/core/src/main/java/org/apache/sqoop/connector/ConnectorHandler.java
+++ b/core/src/main/java/org/apache/sqoop/connector/ConnectorHandler.java
@@ -71,12 +71,9 @@ public final class ConnectorHandler {
       throw new SqoopException(ConnectorError.CONN_0008, connectorClassName);
     }
 
-    Class<?> connectorClass = null;
-    try {
-      connectorClass = ClassUtils.loadClass(connectorClassName);
-    } catch (Exception ex) {
-      throw new SqoopException(ConnectorError.CONN_0005,
-              connectorClassName, ex);
+    Class<?> connectorClass = ClassUtils.loadClass(connectorClassName);
+    if(connectorClass == null) {
+      throw new SqoopException(ConnectorError.CONN_0005, connectorClassName);
     }
 
     try {
@@ -140,4 +137,4 @@ public final class ConnectorHandler {
   public SqoopConnector getSqoopConnector() {
     return connector;
   }
-}
\ No newline at end of file
+}


Mime
View raw message