Author: markt
Date: Thu May  1 10:41:59 2008
New Revision: 652589

URL: http://svn.apache.org/viewvc?rev=652589&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=43656
Add a test case for additional, related bugs and fix those bugs.
Patch by Nils Eckert and test case provided by Konstantin Kolinko.

Added:
    tomcat/tc6.0.x/trunk/test/org/apache/el/
      - copied from r649783, tomcat/trunk/test/org/apache/el/
    tomcat/tc6.0.x/trunk/test/org/apache/el/lang/
      - copied from r649783, tomcat/trunk/test/org/apache/el/lang/
    tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java   
(contents, props changed)
      - copied, changed from r649783, 
tomcat/trunk/test/org/apache/el/lang/TestELSupport.java
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/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=652589&r1=652588&r2=652589&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu May  1 10:41:59 2008
@@ -76,23 +76,6 @@
   +1: fhanik, markt
   -1: 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=43656
-  coerceToType() modifies some values. Patch provided by Nils Eckert
-  http://svn.apache.org/viewvc?rev=649638&view=rev
-  +1: markt, remm, fhanik
-  -1: 
-
-* Add test case for https://issues.apache.org/bugzilla/show_bug.cgi?id=43656
-  http://svn.apache.org/viewvc?rev=649783&view=rev
-  http://svn.apache.org/viewvc?rev=649785&view=rev
-  +1: markt, remm, fhanik
-  -1: 
-
-* Fixes to make test case above pass
-  http://svn.apache.org/viewvc?rev=649784&view=rev
-  +1: markt, remm, fhanik
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=29936
   Create digesters and parsers earlier so we aren't using the webapp class
   loader when we create them.

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=652589&r1=652588&r2=652589&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 Thu May  1 
10:41:59 2008
@@ -225,9 +225,15 @@
             if (number instanceof BigDecimal) {
                 return ((BigDecimal) number).toBigInteger();
             }
+            if (number instanceof BigInteger) {
+                return new BigInteger(number.toString());
+            }
             return BigInteger.valueOf(number.longValue());
         }
         if (BigDecimal.class.equals(type)) {
+            if (number instanceof BigDecimal) {
+                return new BigDecimal(number.toString());
+            }
             if (number instanceof BigInteger) {
                 return new BigDecimal((BigInteger) number);
             }
@@ -336,7 +342,8 @@
 
     public final static Object coerceToType(final Object obj, final Class type)
             throws IllegalArgumentException {
-        if (type == null || Object.class.equals(type)) {
+        if (type == null || Object.class.equals(type) ||
+                type.equals(obj.getClass())) {
             return obj;
         }
         if (String.class.equals(type)) {

Copied: tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java (from 
r649783, tomcat/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?p2=tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java&p1=tomcat/trunk/test/org/apache/el/lang/TestELSupport.java&r1=649783&r2=652589&rev=652589&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/lang/TestELSupport.java (original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java Thu May  1 
10:41:59 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.el.lang;
 
 import java.math.BigDecimal;

Propchange: tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tomcat/tc6.0.x/trunk/test/org/apache/el/lang/TestELSupport.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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=652589&r1=652588&r2=652589&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu May  1 10:41:59 2008
@@ -147,6 +147,11 @@
   <subsection name="Jasper">
     <changelog>
       <fix>
+        <bug>43656</bug>: Fix various numeric coercion bugs. Includes a patch 
by
+        Nils Eckert and fixes related issues identified in a test case provided
+        by Konstantin Kolinko. (markt)
+      </fix>
+      <fix>
         <bug>43741</bug>: Correctly handle dependencies for tag files in JARs.
         (markt)
       </fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to