tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r708161 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/el/lang/ELSupport.java test/org/apache/el/lang/TestELSupport.java webapps/docs/changelog.xml
Date Mon, 27 Oct 2008 13:00:36 GMT
Author: markt
Date: Mon Oct 27 06:00:36 2008
New Revision: 708161

URL: http://svn.apache.org/viewvc?rev=708161&view=rev
Log:
Fix regression in https://issues.apache.org/bugzilla/show_bug.cgi?id=43656
Patch provided by Nils Eckert

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ELSupport.java
    tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=708161&r1=708160&r2=708161&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Oct 27 06:00:36 2008
@@ -178,12 +178,6 @@
   +1: markt
   -0: remm (I also do not think the patch is a good idea as a backport)
 
-* Fix regression in https://issues.apache.org/bugzilla/show_bug.cgi?id=43656
-  Patch provided by Nils Eckert
-  http://svn.apache.org/viewvc?rev=702632&view=rev
-  +1: markt, remm, fhanik
-  -1: 
-
 * Fix issue with nested contexts and context.xml files
   http://svn.apache.org/viewvc?rev=702208&view=rev
   +1: markt, remm, fhanik

Modified: tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ELSupport.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ELSupport.java?rev=708161&r1=708160&r2=708161&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ELSupport.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ELSupport.java Mon Oct 27 06:00:36 2008
@@ -224,13 +224,13 @@
                 return ((BigDecimal) number).toBigInteger();
             }
             if (number instanceof BigInteger) {
-                return new BigInteger(number.toString());
+                return number;
             }
             return BigInteger.valueOf(number.longValue());
         }
         if (BigDecimal.class.equals(type)) {
             if (number instanceof BigDecimal) {
-                return new BigDecimal(number.toString());
+                return number;
             }
             if (number instanceof BigInteger) {
                 return new BigDecimal((BigInteger) number);
@@ -341,7 +341,7 @@
     public final static Object coerceToType(final Object obj, final Class type)
             throws IllegalArgumentException {
         if (type == null || Object.class.equals(type) ||
-                (obj != null && type.equals(obj.getClass()))) {
+                (obj != null && type.isAssignableFrom(obj.getClass()))) {
             return obj;
         }
         if (String.class.equals(type)) {
@@ -356,9 +356,6 @@
         if (Boolean.class.equals(type) || Boolean.TYPE == type) {
             return coerceToBoolean(obj);
         }
-        if (obj != null && type.isAssignableFrom(obj.getClass())) {
-            return obj;
-        }
         if (type.isEnum()) {
             return coerceToEnum(obj, type);
         }

Modified: tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java?rev=708161&r1=708160&r2=708161&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java (original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java Mon Oct 27 06:00:36 2008
@@ -56,6 +56,12 @@
         testIsSame(Float.valueOf(0.123456F));
     }
 
+    public void testCoerceIntegerToNumber() {
+        Integer input = 4390241;
+        Object output = ELSupport.coerceToType(input, Number.class);
+        assertEquals(input, output);
+    }
+
     private static void testIsSame(Object value) {
         assertEquals(value, ELSupport.coerceToNumber(value, value.getClass()));
     }

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=708161&r1=708160&r2=708161&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon Oct 27 06:00:36 2008
@@ -48,6 +48,10 @@
         <bug>41407</bug>: Add CLIENT-CERT support to the JAAS Realm. (markt)
       </add>
       <fix>
+        <bug>43656</bug>: Correct regression in previous fix for this bug. Patch
+        provided by Nils Eckert. (markt)
+      </fix>
+      <fix>
         <bug>45419</bug>: Set Accept-Ranges for static resources served by
         DefaultServlet. (markt)
       </fix>



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


Mime
View raw message