Put distance variable to better use in areParametersCompatible() to fix

ambiguity in StringBuffer methods.
This commit is contained in:
hns 2003-05-09 12:29:45 +00:00
parent 41a29eba7a
commit e387788b36

View file

@ -410,6 +410,12 @@ public abstract class ESLoader extends ESObject {
// The simplest case is direct object compatibility // The simplest case is direct object compatibility
sourceClass = params[i].getClass(); sourceClass = params[i].getClass();
accepted = targetClass.isAssignableFrom(sourceClass); accepted = targetClass.isAssignableFrom(sourceClass);
if (targetClass != sourceClass) {
if (targetClass == Object.class)
distance += 2;
else
distance += 1;
}
debugInfo = " accepted (subclassing)"; debugInfo = " accepted (subclassing)";
if (!accepted) { if (!accepted) {
@ -440,6 +446,7 @@ public abstract class ESLoader extends ESObject {
convertToChar = new boolean[n]; convertToChar = new boolean[n];
} }
convertToChar[i] = true; convertToChar[i] = true;
distance += 1;
debugInfo = " accepted (String(1) as Character)"; debugInfo = " accepted (String(1) as Character)";
} else { } else {
debugInfo = " rejected (String not of length 1)"; debugInfo = " rejected (String not of length 1)";