use of org.codehaus.groovy.runtime.metaclass.MethodSelectionException in project groovy by apache.
the class MetaClassImpl method pickStaticMethod.
private MetaMethod pickStaticMethod(String methodName, Class[] arguments) {
MetaMethod method = null;
MethodSelectionException mse = null;
Object methods = getStaticMethods(theClass, methodName);
if (!(methods instanceof FastArray) || !((FastArray) methods).isEmpty()) {
try {
method = (MetaMethod) chooseMethod(methodName, methods, arguments);
} catch (MethodSelectionException msex) {
mse = msex;
}
}
if (method == null && theClass != Class.class) {
MetaClass classMetaClass = registry.getMetaClass(Class.class);
method = classMetaClass.pickMethod(methodName, arguments);
}
if (method == null) {
method = (MetaMethod) chooseMethod(methodName, methods, MetaClassHelper.convertToTypeArray(arguments));
}
if (method == null && mse != null) {
throw mse;
} else {
return method;
}
}
Aggregations