MCPcopy Index your code
hub / github.com/apache/groovy / findOwnMethod

Method findOwnMethod

src/main/java/groovy/lang/MetaClassImpl.java:4081–4089  ·  view source on GitHub ↗

Chooses the best method declared directly on the supplied meta class. @param instanceKlazz the runtime receiver class @param methodName the method name @param arguments the parameter types @param metaClass the meta class being inspected @param method the current best method candidate @return the up

(Class instanceKlazz, String methodName, Class[] arguments, MetaClass metaClass, MetaMethod method)

Source from the content-addressed store, hash-verified

4079 * @return the updated best method candidate
4080 */
4081 protected static MetaMethod findOwnMethod(Class instanceKlazz, String methodName, Class[] arguments, MetaClass metaClass, MetaMethod method) {
4082 if (instanceKlazz != metaClass.getTheClass()) {
4083 MetaMethod ownMethod = metaClass.pickMethod(methodName, arguments);
4084 if (ownMethod != null && !isPrivate(ownMethod, instanceKlazz)) { // GROOVY-10198
4085 method = (method == null ? ownMethod : mostSpecific(method, ownMethod, instanceKlazz));
4086 }
4087 }
4088 return method;
4089 }
4090
4091 private static boolean isPrivate(MetaMethod method, Class instanceKlazz) {
4092 return method.isPrivate() || (method.isPackagePrivate() && !inSamePackage(method.getDeclaringClass().getTheClass(), instanceKlazz));

Callers 1

getMetaMethodMethod · 0.95

Calls 4

isPrivateMethod · 0.95
mostSpecificMethod · 0.95
getTheClassMethod · 0.65
pickMethodMethod · 0.65

Tested by

no test coverage detected