Author: markt Date: Fri Dec 8 15:57:42 2017 New Revision: 1817517 URL: http://svn.apache.org/viewvc?rev=1817517&view=rev Log: Follow-up to r1817495
Modified: tomcat/trunk/java/org/apache/el/util/ReflectionUtil.java tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java Modified: tomcat/trunk/java/org/apache/el/util/ReflectionUtil.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/util/ReflectionUtil.java?rev=1817517&r1=1817516&r2=1817517&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/el/util/ReflectionUtil.java (original) +++ tomcat/trunk/java/org/apache/el/util/ReflectionUtil.java Fri Dec 8 15:57:42 2017 @@ -180,12 +180,12 @@ public class ReflectionUtil { } if (m.isVarArgs() && paramCount > mParamCount && paramValues != null && paramValues.length != paramCount) { - // Number of parameter types and values do not agree - throw new IllegalArgumentException(); + // Might match a different varargs method + continue; } if (!m.isVarArgs() && paramValues != null && paramCount != paramValues.length) { - // Number of parameter types and values do not agree - throw new IllegalArgumentException(); + // Might match a different varargs method + continue; } // Check the parameters match @@ -196,7 +196,7 @@ public class ReflectionUtil { for (int i = 0; i < mParamCount; i++) { // Can't be null if (m.isVarArgs() && i == (mParamCount - 1)) { - if (i == paramCount && paramCount == (mParamCount - 1)) { + if (i == paramCount || (paramValues != null && paramValues.length == i)) { // Nothing is passed as varargs assignableMatch++; break; Modified: tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java?rev=1817517&r1=1817516&r2=1817517&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java (original) +++ tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java Fri Dec 8 15:57:42 2017 @@ -490,7 +490,7 @@ public class TestMethodExpressionImpl { } - @Test(expected=IllegalArgumentException.class) + @Test(expected=MethodNotFoundException.class) public void testBug57855a() { MethodExpression me = factory.createMethodExpression(context, "${beanAA.echo2}", null , new Class[]{String.class}); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org