public MethodRef resolve(String functionName) {
MethodEntry entry = methods.get(functionName);
if (entry != null) {
Method method = findMethod(entry.clazz, entry.methodName);
if (method != null) {
return new JvmMethodRef(method);
}
}
for (Class clazz : referenceClasses) {
Method method = findMethod(clazz, functionName);
if (method != null) {
return new JvmMethodRef(method);
}
}
throw new IllegalArgumentException("No matching method for " + functionName);
}