From a02f5f345f6dd0b7658b380fbc8c658ddb304707 Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 8 Apr 2008 22:26:05 +0000 Subject: [PATCH] Better patch for 44766. I still can't see why the original code listed the classes individually. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@646106 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/el/lang/ELArithmetic.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/org/apache/el/lang/ELArithmetic.java b/java/org/apache/el/lang/ELArithmetic.java index f78fea3a1..cac628339 100644 --- a/java/org/apache/el/lang/ELArithmetic.java +++ b/java/org/apache/el/lang/ELArithmetic.java @@ -326,8 +326,11 @@ public abstract class ELArithmetic { return (obj != null && isNumberType(obj.getClass())); } - public final static boolean isNumberType(final Class type) { - return type == (java.lang.Long.class) || type == Long.TYPE || type == (java.lang.Double.class) || type == Double.TYPE || type == (java.lang.Byte.class) || type == Byte.TYPE || type == (java.lang.Short.class) || type == Short.TYPE || type == (java.lang.Integer.class) || type == Integer.TYPE || type == (java.lang.Float.class) || type == Float.TYPE || type == (java.math.BigInteger.class) || type == (java.math.BigDecimal.class); + public final static boolean isNumberType(final Class type) { + return type == Long.TYPE || type == Double.TYPE || + type == Byte.TYPE || type == Short.TYPE || + type == Integer.TYPE || type == Float.TYPE || + Number.class.isAssignableFrom(type); } /** -- 2.11.0