mirror of
https://github.com/apache/sqoop.git
synced 2025-05-20 10:51:21 +08:00
SQOOP-2388: Sqoop2: Remove duplicate code in ConfigUtils.fromConfigs()
(Dian Fu via Richard Zhou)
This commit is contained in:
parent
519693643a
commit
3e50a3b7ee
@ -270,15 +270,7 @@ public static void fromConfigs(List<MConfig> configs, Object configuration) {
|
|||||||
Class klass = configuration.getClass();
|
Class klass = configuration.getClass();
|
||||||
|
|
||||||
for(MConfig config : configs) {
|
for(MConfig config : configs) {
|
||||||
Field configField;
|
Field configField = getFieldFromName(klass, config.getName());
|
||||||
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());
|
|
||||||
// We need to access this field even if it would be declared as private
|
// We need to access this field even if it would be declared as private
|
||||||
configField.setAccessible(true);
|
configField.setAccessible(true);
|
||||||
Class<?> configClass = configField.getType();
|
Class<?> configClass = configField.getType();
|
||||||
|
Loading…
Reference in New Issue
Block a user