Fix EL issue reported on users list by obtaining class information directly from...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 31 May 2010 18:39:55 +0000 (18:39 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 31 May 2010 18:39:55 +0000 (18:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@949829 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/el/parser/AstValue.java

index 94293cd..fedf6d1 100644 (file)
@@ -244,10 +244,9 @@ public final class AstValue extends SimpleNode {
         Method m = null;
         Object[] values = null;
         if (isParametersProvided()) {
-            Class<?>[] types = ((AstMethodParameters)
-                    this.jjtGetChild(2)).getParameterTypes(ctx);
             values = ((AstMethodParameters)
                     this.jjtGetChild(2)).getParameters(ctx);
+            Class<?>[] types = getTypesFromValues(values);
             m = ReflectionUtil.getMethod(t.base, t.property, types);
         } else {
             m = ReflectionUtil.getMethod(t.base, t.property, paramTypes);
@@ -266,6 +265,23 @@ public final class AstValue extends SimpleNode {
         return result;
     }
 
+    private Class<?>[] getTypesFromValues(Object[] values) {
+        if (values == null) {
+            return null;
+        }
+        
+        Class<?> result[] = new Class<?>[values.length];
+        for (int i = 0; i < values.length; i++) {
+            if (values[i] == null) {
+                result[i] = null;
+            } else {
+                result[i] = values[i].getClass();
+            }
+        }
+        return result;
+    }
+
+    
     /**
      * @since EL 2.2
      */