Bug 44294 - Support for EL functions with varargs
Summary: Support for EL functions with varargs
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 6.0.14
Hardware: Other other
: P2 enhancement (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2008-01-25 02:39 UTC by Tuomas Kiviaho
Modified: 2016-12-01 20:59 UTC (History)
0 users

AstFunction.patch (1.45 KB, patch)
2008-01-25 02:44 UTC, Tuomas Kiviaho
Details | Diff
AstFunction.patch (1.58 KB, patch)
2008-02-19 23:50 UTC, Tuomas Kiviaho
Details | Diff
ExpressionBuilder.patch (689 bytes, patch)
2008-02-20 02:48 UTC, Tuomas Kiviaho
Details | Diff
alternative.patch (3.20 KB, patch)
2008-02-20 03:11 UTC, Tuomas Kiviaho
Details | Diff
FunctionMapperImpl.patch (915 bytes, patch)
2008-02-26 05:42 UTC, Tuomas Kiviaho
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tuomas Kiviaho 2008-01-25 02:39:33 UTC
Varargs <http://java.sun.com/j2se/1.5.0/docs/guide/language/varargs.html> could
be supported easily since it is possible to retrieve the information whether or
not method has vargargs and vararg can only exist as last argument.
Comment 1 Tuomas Kiviaho 2008-01-25 02:44:16 UTC
Created attachment 21426 [details]
Comment 2 Tuomas Kiviaho 2008-02-19 23:50:03 UTC
Created attachment 21567 [details]
Comment 3 Tuomas Kiviaho 2008-02-20 02:48:13 UTC
Created attachment 21569 [details]

ExpressionBuilder has parameter length check that has to deal with var args as
well. I think this is premature validation as the purpose of visitor is merely
to populate variable mapper and function resolver. I believe it would be more
consistent move this check to AstFunction.

Please note that JSP translation time validation is done at
org.apache.jasper.compiler.Validator.ValidateVisitor.getFunctionMapper. Vararg
support could/should be implemented these as well.
Comment 4 Tuomas Kiviaho 2008-02-20 03:11:58 UTC
Created attachment 21570 [details]

Alternative approach where logic from ExpressionBuilder is moved to AstFunction
Comment 5 Tuomas Kiviaho 2008-02-26 05:42:44 UTC
Created attachment 21593 [details]


	at org.apache.el.parser.AstFunction.getValue(AstFunction.java:87)

alternative.patch revealed that FunctionMapperImpl doesn't quite comply with
the API
Comment 6 Mark Thomas 2016-12-01 20:59:46 UTC
Fixed by back-porting existing support from 8.0.x

Fixed in:
- 7.0.x for 7.0.74 onwards
- 6.0.x for 6.0.49 onwards