Bug 51852

Summary: BeanELResolver varargs handling is broken in multiple ways
Product: Tomcat 7 Reporter: Matt Benson <mbenson>
Component: Servlet & JSP APIAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: mbenson
Priority: P2    
Version: trunk   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Proposed patch

Description Matt Benson 2011-09-20 19:16:07 UTC
The supplied patch (against SVN Revision 1173292) addresses:
 - Incorrectly constructed varargs arguments (resulting in ArrayIndexOutOfBoundsExceptions)
 - Incorrectly detected matching varargs methods

I originally encountered the first issue in my JSF application using the JUEL EL implementation in conjunction with Tomcat's EL API.  However I continue to get the error even when dropping JUEL from the application, so I'm not sure why in some instances the Jasper implementation seems to handle the varargs invocations and in others the BeanELResolver is invoked.  In any event, code that already resides in BeanELResolver should certainly function properly, and mixing a given ExpressionFactory implementation with any conforming API implementation should AFAICT be feasible.

The second issue I encountered while debugging the first issue.
Comment 1 Matt Benson 2011-09-20 19:17:16 UTC
Created attachment 27543 [details]
Proposed patch

I grant the ASF license to incorporate the contents of the submitted patch.
Comment 2 Mark Thomas 2011-09-21 13:41:56 UTC
Many thanks for the patch and especially for including the test case.

The patch has been applied to trunk and 7.0.x and will be included in 7.0.22 onwards.