Author: markt
Date: Fri Dec  8 16:07:20 2017
New Revision: 1817520

URL: http://svn.apache.org/viewvc?rev=1817520&view=rev
Log:
Copy changes in ReflectionUtil in r1817517 to Util.
Update unit tests for change in exception type

Modified:
    tomcat/trunk/java/javax/el/Util.java
    tomcat/trunk/test/javax/el/TestBeanELResolver.java

Modified: tomcat/trunk/java/javax/el/Util.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/Util.java?rev=1817520&r1=1817519&r2=1817520&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/Util.java (original)
+++ tomcat/trunk/java/javax/el/Util.java Fri Dec  8 16:07:20 2017
@@ -254,12 +254,12 @@ class Util {
             }
             if (w.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 (!w.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
@@ -270,7 +270,7 @@ class Util {
             for (int i = 0; i < mParamCount; i++) {
                 // Can't be null
                 if (w.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/javax/el/TestBeanELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/javax/el/TestBeanELResolver.java?rev=1817520&r1=1817519&r2=1817520&view=diff
==============================================================================
--- tomcat/trunk/test/javax/el/TestBeanELResolver.java (original)
+++ tomcat/trunk/test/javax/el/TestBeanELResolver.java Fri Dec  8 16:07:20 2017
@@ -639,7 +639,7 @@ public class TestBeanELResolver {
         Assert.assertEquals(BEAN_NAME, result);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MethodNotFoundException.class)
     public void testInvokeVarargsCoerce17() {
         BeanELResolver resolver = new BeanELResolver();
         ELContext context = new 
StandardELContext(ELManager.getExpressionFactory());
@@ -651,7 +651,7 @@ public class TestBeanELResolver {
         Assert.assertEquals(BEAN_NAME, result);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MethodNotFoundException.class)
     public void testInvokeVarargsCoerce18() {
         BeanELResolver resolver = new BeanELResolver();
         ELContext context = new 
StandardELContext(ELManager.getExpressionFactory());
@@ -675,7 +675,7 @@ public class TestBeanELResolver {
         Assert.assertEquals(BEAN_NAME, result);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MethodNotFoundException.class)
     public void testInvokeVarargsCoerce20() {
         BeanELResolver resolver = new BeanELResolver();
         ELContext context = new 
StandardELContext(ELManager.getExpressionFactory());
@@ -687,7 +687,7 @@ public class TestBeanELResolver {
         Assert.assertEquals(BEAN_NAME, result);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MethodNotFoundException.class)
     public void testInvokeVarargsCoerce21() {
         BeanELResolver resolver = new BeanELResolver();
         ELContext context = new 
StandardELContext(ELManager.getExpressionFactory());
@@ -878,7 +878,7 @@ public class TestBeanELResolver {
         Assert.assertEquals(BEAN_NAME, result);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MethodNotFoundException.class)
     public void testInvokeVarargs17() {
         BeanELResolver resolver = new BeanELResolver();
         ELContext context = new 
StandardELContext(ELManager.getExpressionFactory());
@@ -890,7 +890,7 @@ public class TestBeanELResolver {
         Assert.assertEquals(BEAN_NAME, result);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MethodNotFoundException.class)
     public void testInvokeVarargs18() {
         BeanELResolver resolver = new BeanELResolver();
         ELContext context = new 
StandardELContext(ELManager.getExpressionFactory());
@@ -914,7 +914,7 @@ public class TestBeanELResolver {
         Assert.assertEquals(BEAN_NAME, result);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MethodNotFoundException.class)
     public void testInvokeVarargs20() {
         BeanELResolver resolver = new BeanELResolver();
         ELContext context = new 
StandardELContext(ELManager.getExpressionFactory());
@@ -926,7 +926,7 @@ public class TestBeanELResolver {
         Assert.assertEquals(BEAN_NAME, result);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MethodNotFoundException.class)
     public void testInvokeVarargs21() {
         BeanELResolver resolver = new BeanELResolver();
         ELContext context = new 
StandardELContext(ELManager.getExpressionFactory());



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to