Index: org/apache/el/lang/ELArithmetic.java =================================================================== --- org/apache/el/lang/ELArithmetic.java (revision 646133) +++ org/apache/el/lang/ELArithmetic.java (working copy) @@ -164,8 +164,6 @@ || obj1 instanceof Double || obj0 instanceof Float || obj1 instanceof Float - || (obj0 != null && (Double.TYPE == obj0.getClass() || Float.TYPE == obj0.getClass())) - || (obj1 != null && (Double.TYPE == obj1.getClass() || Float.TYPE == obj1.getClass())) || (obj0 instanceof String && ELSupport .isStringFloat((String) obj0)) || (obj1 instanceof String && ELSupport .isStringFloat((String) obj1))); @@ -359,13 +357,12 @@ return coerce(ZERO); } - Class objType = obj.getClass(); - if (Character.class.equals(objType) || Character.TYPE == objType) { + if (obj instanceof Character) { return coerce(new Short((short) ((Character) obj).charValue())); } throw new IllegalArgumentException(MessageFactory.get("error.convert", - obj, objType, "Number")); + obj, obj.getClass(), "Number")); } protected abstract Number coerce(final String str); Index: org/apache/el/lang/ELSupport.java =================================================================== --- org/apache/el/lang/ELSupport.java (revision 646133) +++ org/apache/el/lang/ELSupport.java (working copy) @@ -164,7 +164,7 @@ if (obj == null || "".equals(obj)) { return Boolean.FALSE; } - if (obj instanceof Boolean || obj.getClass() == Boolean.TYPE) { + if (obj instanceof Boolean) { return (Boolean) obj; } if (obj instanceof String) { @@ -187,7 +187,7 @@ return new Character((char) ((Number) obj).shortValue()); } Class objType = obj.getClass(); - if (obj instanceof Character || objType == Character.TYPE) { + if (obj instanceof Character) { return (Character) obj; } @@ -259,14 +259,13 @@ return coerceToNumber((Number) obj, type); } - Class objType = obj.getClass(); - if (Character.class.equals(objType) || Character.TYPE == objType) { + if (obj instanceof Character) { return coerceToNumber(new Short((short) ((Character) obj) .charValue()), type); } throw new IllegalArgumentException(MessageFactory.get("error.convert", - obj, objType, type)); + obj, obj.getClass(), type)); } protected final static Number coerceToNumber(final String val, @@ -402,10 +401,7 @@ return (obj0 instanceof Double || obj1 instanceof Double || obj0 instanceof Float - || obj1 instanceof Float - || (obj0 != null && (Double.TYPE == obj0.getClass() || Float.TYPE == obj0 - .getClass())) || (obj1 != null && (Double.TYPE == obj1 - .getClass() || Float.TYPE == obj1.getClass()))); + || obj1 instanceof Float); } public final static boolean isDoubleStringOp(final Object obj0, @@ -424,17 +420,7 @@ || obj0 instanceof Short || obj1 instanceof Short || obj0 instanceof Byte - || obj1 instanceof Byte - || (obj0 != null && (Long.TYPE == obj0.getClass() - || Integer.TYPE == obj0.getClass() - || Character.TYPE == obj0.getClass() - || Short.TYPE == obj0.getClass() || Byte.TYPE == obj0 - .getClass())) || (obj0 != null && (Long.TYPE == obj0 - .getClass() - || Integer.TYPE == obj0.getClass() - || Character.TYPE == obj0.getClass() - || Short.TYPE == obj0.getClass() || Byte.TYPE == obj0 - .getClass()))); + || obj1 instanceof Byte); } public final static boolean isStringFloat(final String str) { Index: org/apache/el/parser/AstNegative.java =================================================================== --- org/apache/el/parser/AstNegative.java (revision 646133) +++ org/apache/el/parser/AstNegative.java (working copy) @@ -59,23 +59,22 @@ } return new Long(-Long.parseLong((String) obj)); } - Class type = obj.getClass(); - if (obj instanceof Long || Long.TYPE == type) { + if (obj instanceof Long) { return new Long(-((Long) obj).longValue()); } - if (obj instanceof Double || Double.TYPE == type) { + if (obj instanceof Double) { return new Double(-((Double) obj).doubleValue()); } - if (obj instanceof Integer || Integer.TYPE == type) { + if (obj instanceof Integer) { return new Integer(-((Integer) obj).intValue()); } - if (obj instanceof Float || Float.TYPE == type) { + if (obj instanceof Float) { return new Float(-((Float) obj).floatValue()); } - if (obj instanceof Short || Short.TYPE == type) { + if (obj instanceof Short) { return new Short((short) -((Short) obj).shortValue()); } - if (obj instanceof Byte || Byte.TYPE == type) { + if (obj instanceof Byte) { return new Byte((byte) -((Byte) obj).byteValue()); } Long num = (Long) coerceToNumber(obj, Long.class);