use of javassist.CtMethod in project leopard by tanhaichao.
the class CtClassUtil method getParameterNames.
public static String[] getParameterNames(Class<?> clazz, Method method) {
CtMethod ctMethod;
try {
ctMethod = CtClassUtil.getMethod(clazz, method);
} catch (NotFoundException e) {
Throwable error = e.getCause();
if (error instanceof RuntimeException) {
throw (RuntimeException) error;
}
if (error instanceof Exception) {
throw new RuntimeException(error.getMessage(), error);
}
throw new RuntimeException(e.getMessage(), e);
}
String[] names;
try {
names = getParameterNames(ctMethod);
} catch (NotFoundException e) {
throw new RuntimeException(e.getMessage(), e);
}
// System.err.println("getParameterNames methodName:" + method.toGenericString() + " names:" + StringUtils.join(names, ", "));
return names;
}
Aggregations