public static boolean isValidMethod(Object method, Class[] arguments) { return getParameterTypes(method).isValidMethod(arguments); }
for (Iterator iter = matchingMethods.iterator(); iter.hasNext();) { Object method = iter.next(); ParameterTypes paramTypes = MetaClassHelper.getParameterTypes(method); long dist = MetaClassHelper.calculateParameterDistance(arguments, paramTypes); if (dist == 0) return method; msg += " due to overlapping prototypes between:"; for (Iterator iter = matches.iterator(); iter.hasNext();) { Class[] types = MetaClassHelper.getParameterTypes(iter.next()).getNativeParameterTypes(); msg += "\n\t" + InvokerHelper.toString(types);
for (Iterator iter = matchingMethods.iterator(); iter.hasNext();) { Object method = iter.next(); final ParameterTypes parameterTypes = MetaClassHelper.getParameterTypes(method); Class[] paramTypes = parameterTypes.getNativeParameterTypes(); if (!MetaClassHelper.parametersAreCompatible(arguments, paramTypes)) continue; msg += " due to overlapping prototypes between:"; for (Iterator iter = matches.iterator(); iter.hasNext();) { CachedClass[] types = MetaClassHelper.getParameterTypes(iter.next()).getParameterTypes(); msg += "\n\t" + InvokerHelper.toString(types);
/** * @param methods the methods to choose from * @return the method with 1 parameter which takes the most general type of * object (e.g. Object) */ public static Object chooseEmptyMethodParams(FastArray methods) { Object vargsMethod = null; final int len = methods.size(); final Object[] data = methods.getArray(); for (int i = 0; i != len; ++i) { Object method = data[i]; final ParameterTypes pt = getParameterTypes(method); CachedClass[] paramTypes = pt.getParameterTypes(); int paramLength = paramTypes.length; if (paramLength == 0) { return method; } else if (paramLength == 1 && pt.isVargsMethod(EMPTY_ARRAY)) { vargsMethod = method; } } return vargsMethod; }
final Object[] data = methods.getArray(); Object method = data[i]; final ParameterTypes pt = getParameterTypes(method); CachedClass[] paramTypes = pt.getParameterTypes(); int paramLength = paramTypes.length;