Object[] resolvedArguments = argumentsResolver.resolveArguments(methods[i], args);
candidates.add(new MethodHolder(methodId, bean, methods[i], resolvedArguments));
}
}
if (candidates.isEmpty()) {
throw new JibeRuntimeException("Method " + methodId + " could not be found");
}
Double bestGuess = null;
MethodHolder bestCandidate = null;
for (MethodHolder candidate : candidates) {
double guess = candidate.getQuality();
if (bestGuess == null || guess > bestGuess) {
bestGuess = guess;
bestCandidate = candidate;
}
}
return bestCandidate;
}
throw new JibeRuntimeException(
"It is only possible to invoke methods on classes annotated with @Controller or @UIComponent annotations: "
+ methodId);
}