}
public List<ResolvedMethodParameter> methodParameters(final HandlerMethod methodToResolve) {
Class hostClass = use(methodToResolve.getBeanType())
.or(methodToResolve.getMethod().getDeclaringClass());
ResolvedMethod resolvedMethod = getResolvedMethod(methodToResolve.getMethod(), hostClass);
List<ResolvedMethodParameter> parameters = newArrayList();
MethodParameter[] methodParameters = methodToResolve.getMethodParameters();
if (resolvedMethod != null) {
if (methodParameters.length == resolvedMethod.getArgumentCount()) {
for (int index = 0; index < resolvedMethod.getArgumentCount(); index++) {
MethodParameter methodParameter = methodParameters[index];
methodParameter.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
parameters.add(new ResolvedMethodParameter(methodParameter, resolvedMethod.getArgumentType(index)));
}
} else {
log.warn(String.format("Problem trying to resolve a method named %s", methodToResolve.getMethod().getName()));
log.warn(String.format("Method parameter count %s does not match resolved method argument count %s",
methodParameters.length, resolvedMethod.getArgumentCount()));
}
}
return parameters;
}