Improve method resolution in EL expressions
Add test cases for this bug
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1071561 13f79535-47bb-0310-9956-
ffa450edef68
}
Method[] methods = clazz.getMethods();
for (Method m : methods) {
- if (m.getParameterTypes().length == paramCount) {
+ if (methodName.equals(m.getName()) &&
+ m.getParameterTypes().length == paramCount) {
// Same number of parameters - use the first match
matchingMethod = m;
break;
AstMethodParameters mps =
(AstMethodParameters) this.children[i+1];
// This is a method
- base = resolver.invoke(ctx, base, suffix,
- mps.getParameterTypes(ctx), mps.getParameters(ctx));
+ base = resolver.invoke(ctx, base, suffix, null,
+ mps.getParameters(ctx));
i+=2;
} else {
// This is a property
String actual = (String) me1.invoke(context, null);
assertEquals("Hello Tomcat from B", actual);
}
+
+ public void testBug50790a() throws Exception {
+ ValueExpression ve = factory.createValueExpression(context,
+ "#{beanAA.name.contains(beanA.name)}", java.lang.Boolean.class);
+ Boolean actual = (Boolean) ve.getValue(context);
+ assertEquals(Boolean.TRUE, actual);
+ }
+
+ public void testBug50790b() throws Exception {
+ ValueExpression ve = factory.createValueExpression(context,
+ "#{beanA.name.contains(beanAA.name)}", java.lang.Boolean.class);
+ Boolean actual = (Boolean) ve.getValue(context);
+ assertEquals(Boolean.FALSE, actual);
+ }
}
not result in String constants that are too long for valid Java code.
(markt)
</fix>
+ <fix>
+ <bug>50790</bug>: Improve method resolution in EL expressions. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Cluster">