sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rzh...@apache.org
Subject sqoop git commit: SQOOP-2388: Sqoop2: Remove duplicate code in ConfigUtils.fromConfigs()
Date Mon, 08 Jun 2015 10:11:29 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 d9101e229 -> 3e50a3b7e (forced update)


SQOOP-2388: Sqoop2: Remove duplicate code in ConfigUtils.fromConfigs()

(Dian Fu via Richard Zhou)


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

Branch: refs/heads/sqoop2
Commit: 3e50a3b7ee05c11f9c5a9637a5c7dbc8a148fd86
Parents: 5196936
Author: Richard <richard.zhou@intel.com>
Authored: Mon Jun 8 17:52:27 2015 +0800
Committer: Richard Zhou <richard.zhou@intel.com>
Committed: Mon Jun 8 18:00:33 2015 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/sqoop/model/ConfigUtils.java | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/3e50a3b7/common/src/main/java/org/apache/sqoop/model/ConfigUtils.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/model/ConfigUtils.java b/common/src/main/java/org/apache/sqoop/model/ConfigUtils.java
index d584079..72565c7 100644
--- a/common/src/main/java/org/apache/sqoop/model/ConfigUtils.java
+++ b/common/src/main/java/org/apache/sqoop/model/ConfigUtils.java
@@ -270,15 +270,7 @@ public class  ConfigUtils {
     Class klass = configuration.getClass();
 
     for(MConfig config : configs) {
-      Field configField;
-      try {
-        configField = klass.getDeclaredField(config.getName());
-      } catch (NoSuchFieldException e) {
-        throw new SqoopException(ModelError.MODEL_006,
-          "Missing field " + config.getName() + " on config class " + klass.getCanonicalName(),
e);
-      }
-
-      configField = getFieldFromName(klass, config.getName());
+      Field configField = getFieldFromName(klass, config.getName());
       // We need to access this field even if it would be declared as private
       configField.setAccessible(true);
       Class<?> configClass = configField.getType();


Mime
View raw message