Author: markt Date: Mon May 31 18:39:55 2010 New Revision: 949829 URL: http://svn.apache.org/viewvc?rev=949829&view=rev Log: Fix EL issue reported on users list by obtaining class information directly from the values rather than via getType() which is likely to return a more generic type that the actual type of the value.
Modified: tomcat/trunk/java/org/apache/el/parser/AstValue.java Modified: tomcat/trunk/java/org/apache/el/parser/AstValue.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/AstValue.java?rev=949829&r1=949828&r2=949829&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/el/parser/AstValue.java (original) +++ tomcat/trunk/java/org/apache/el/parser/AstValue.java Mon May 31 18:39:55 2010 @@ -244,10 +244,9 @@ public final class AstValue extends Simp 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 Simp 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 */ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org