From: markt Date: Sun, 4 Apr 2010 10:09:18 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48914 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9f3fbe424ff92666bb9a79c2c1511890c98b51fa;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48914 Invoke should use parameters provided in expression in preference to parameters provided in invoke() call git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@930653 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/el/parser/AstValue.java b/java/org/apache/el/parser/AstValue.java index 1c3738749..a0ce1d715 100644 --- a/java/org/apache/el/parser/AstValue.java +++ b/java/org/apache/el/parser/AstValue.java @@ -216,11 +216,23 @@ public final class AstValue extends SimpleNode { public Object invoke(EvaluationContext ctx, @SuppressWarnings("unchecked") Class[] paramTypes, Object[] paramValues) throws ELException { + Target t = getTarget(ctx); - Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes); + Method m = null; + Object[] values = null; + if (isParametersProvided()) { + Class[] types = ((AstMethodParameters) + this.jjtGetChild(2)).getParameterTypes(ctx); + values = ((AstMethodParameters) + this.jjtGetChild(2)).getParameters(ctx); + m = ReflectionUtil.getMethod(t.base, t.property, types); + } else { + m = ReflectionUtil.getMethod(t.base, t.property, paramTypes); + values = paramValues; + } Object result = null; try { - result = m.invoke(t.base, paramValues); + result = m.invoke(t.base, values); } catch (IllegalAccessException iae) { throw new ELException(iae); } catch (IllegalArgumentException iae) {