Author: markt
Date: Sun Apr 4 10:09:18 2010
New Revision: 930653
URL: http://svn.apache.org/viewvc?rev=930653&view=rev
Log:
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
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=930653&r1=930652&r2=930653&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/AstValue.java (original)
+++ tomcat/trunk/java/org/apache/el/parser/AstValue.java Sun Apr 4 10:09:18
2010
@@ -216,11 +216,23 @@ public final class AstValue extends Simp
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) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]