Do not allow Strings parameters of length 1 to be casted into a number.

This commit is contained in:
hns 2003-01-29 16:02:19 +00:00
parent a2c4745d8e
commit d93efaa377

View file

@ -432,11 +432,7 @@ public abstract class ESLoader extends ESObject {
debugInfo = " rejected (not widening numbers)";
}
// Handle String of length 1 as a Char, which can be converted to a number
} else if ((targetClass == Character.class ||
targetClass == Integer.class ||
targetClass == Long.class ||
targetClass == Float.class ||
targetClass == Double.class)
} else if (targetClass == Character.class
&& params[i] instanceof String) {
if (((String) params[i]).length()==1) {
accepted = true; // will require conversion of parameter