tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r646106 - /tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java
Date Tue, 08 Apr 2008 22:26:06 GMT
Author: markt
Date: Tue Apr  8 15:26:05 2008
New Revision: 646106

URL: http://svn.apache.org/viewvc?rev=646106&view=rev
Log:
Better patch for 44766. I still can't see why the original code listed the classes individually.

Modified:
    tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java

Modified: tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java?rev=646106&r1=646105&r2=646106&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java (original)
+++ tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java Tue Apr  8 15:26:05 2008
@@ -326,8 +326,11 @@
         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);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message