MCPcopy Index your code
hub / github.com/beanshell/beanshell / findOverloadedMethod

Method findOverloadedMethod

src/bsh/Reflect.java:478–491  ·  view source on GitHub ↗

Get the candidate methods by searching the class and interface graph of baseClass and resolve the most specific. @return the method or null for not found

(final Class baseClass, final String methodName, final Class[] types, final boolean publicOnly)

Source from the content-addressed store, hash-verified

476 * @return the method or null for not found
477 */
478 private static Method findOverloadedMethod(final Class baseClass, final String methodName, final Class[] types, final boolean publicOnly) {
479 if (Interpreter.DEBUG) {
480 Interpreter.debug("Searching for method: " + StringUtil.methodString(methodName, types) + " in '" + baseClass.getName() + "'");
481 }
482 final List<Method> publicMethods = new ArrayList<Method>();
483 final Collection<Method> nonPublicMethods = publicOnly ? new DummyCollection<Method>() : new ArrayList<Method>();
484 collectMethods(baseClass, methodName, types.length, publicMethods, nonPublicMethods);
485 Collections.sort(publicMethods, METHOD_COMPARATOR);
486 Method method = findMostSpecificMethod(types, publicMethods);
487 if (method == null) {
488 method = findMostSpecificMethod(types, nonPublicMethods);
489 }
490 return method;
491 }
492
493
494 /**

Callers 1

resolveJavaMethodMethod · 0.95

Calls 5

debugMethod · 0.95
methodStringMethod · 0.95
collectMethodsMethod · 0.95
getNameMethod · 0.45

Tested by

no test coverage detected