Retrieve a list of function parameter names from a method
Returns null if unable to read parameter names (i.e. bytecode not
built with debug).
// Don't worry about it if there are no params.
int numParams = method.getParameterTypes().length;
if (numParams == 0)
return null;
// get declaring class
Class c = method.getDeclaringClass();
// Don't worry about it if the class is a Java dynamic proxy
if(Proxy.isProxyClass(c)) {
return null;
}
try {
// get a parameter reader
ParamReader pr = new ParamReader(c);
// get the paramter names
String[] names = pr.getParameterNames(method);
return names;
} catch (IOException e) {
// log it and leave
log.info(Messages.getMessage("error00") + ":" + e);
return null;
}