Fix bug 43656. coerceToType() modified some values. Patch provided by Nils Eckert.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 18 Apr 2008 18:10:06 +0000 (18:10 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 18 Apr 2008 18:10:06 +0000 (18:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@649638 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/el/lang/ELSupport.java

index 18a53bc..c638c6d 100644 (file)
@@ -334,7 +334,8 @@ public class ELSupport {
 
     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)) {