bestCandidate = meth;
break;
}
for (int i = 0; i != arguments.length; i++) {
MetaClass actualParamType;
if (isVarArgs && !arguments[arguments.length - 1].isArray() && i >= parmTypes.length - 1)
actualParamType = parmTypes[parmTypes.length - 1].getType().getComponentType();
else
actualParamType = parmTypes[i].getType();
if (arguments[i] == null) {
if (!actualParamType.isPrimitive()) {
score += 6;
}
else {
score = 0;
break;
}
}
else if (actualParamType.equals(arguments[i])) {
score += 7;
}
else if (actualParamType.isPrimitive() && actualParamType.asBoxed().equals(arguments[i])) {
score += 6;
}
else if (arguments[i].isPrimitive() && arguments[i].asUnboxed().equals(actualParamType)) {
score += 6;
}
else if (actualParamType.isAssignableFrom(arguments[i])) {
score += 5;
}
else if (isNumericallyCoercible(arguments[i], actualParamType)) {
score += 4;
}
else if (actualParamType.asBoxed().isAssignableFrom(arguments[i].asBoxed())
&& !Object_MetaClass.equals(arguments[i])) {
score += 3 + scoreInterface(actualParamType, arguments[i]);
}
else if (canConvert(actualParamType, arguments[i])) {
if (actualParamType.isArray() && arguments[i].isArray()) score += 1;
else if (actualParamType.equals(char_MetaClass) && arguments[i].equals(String_MetaClass)) score += 1;
score += 1;
}
else if (actualParamType.equals(Object_MetaClass) || arguments[i].equals(NullType_MetaClass)) {
score += 1;
}
else {
score = 0;
break;