请看一下下面代码有什么问题?

/**
*
* getBean: 将属性值map转化成对象
*
* @exception DepException
* @param valueMap
* 属性值map
* @param clz
* 类
* @return 对象
* @throws DepException
* TODO Description

*/
public static Object getBean(Map valueMap, Class clz) throws DepException {
Object obj;
try {
obj = clz.newInstance();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
throw new DepException(e.getMessage());
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
throw new DepException(e.getMessage());
}
for (String key : valueMap.keySet()) {
Object value = valueMap.get(key);
if (null == value) {
continue;
} else {
String setMetName = parSetName(key);
Method setMet;
try {
Class valueClz = value.getClass();
if ("java.util.ArrayList".equals(valueClz.getName())) {
valueClz = List.class;
}
setMet = clz.getMethod(setMetName, valueClz);
} catch (SecurityException e) {
// TODO Auto-generated catch block
throw new DepException(e.getMessage());
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
throw new DepException(e.getMessage());
}
try {
setMet.invoke(obj, value);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
throw new DepException(e.getMessage());
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
throw new DepException(e.getMessage());
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
throw new DepException(e.getMessage());
}
}
}
return obj;
}
public static String parSetName(String fieldName) {
if (StringUtils.isBlank(fieldName)) {
return null;
}
return "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
}
}

这代码都是自动生成的能有什么错。检查下环境配置之类的问题。

首先说一个,这代码看着头晕,建议代码有异常时不要急着catch异常,写到最后再用try-catch包围