ASF Bugzilla – Attachment 21426 Details for
Bug 44294
Support for EL functions with varargs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
AstFunction.patch
AstFunction.patch (text/plain), 1.45 KB, created by
Tuomas Kiviaho
on 2008-01-25 02:44:16 UTC
(
hide
)
Description:
AstFunction.patch
Filename:
MIME Type:
Creator:
Tuomas Kiviaho
Created:
2008-01-25 02:44:16 UTC
Size:
1.45 KB
patch
obsolete
>Index: org/apache/el/parser/AstFunction.java >=================================================================== >--- org/apache/el/parser/AstFunction.java (revision 607569) >+++ org/apache/el/parser/AstFunction.java (working copy) >@@ -97,10 +97,20 @@ > if (numParams > 0) { > params = new Object[numParams]; > try { >- for (int i = 0; i < numParams; i++) { >+ int lastParam = m.isVarArgs() ? paramTypes.length - 1 : numParams; >+ for (int i = 0; i < lastParam; i++) { > params[i] = this.children[i].getValue(ctx); > params[i] = coerceToType(params[i], paramTypes[i]); > } >+ if (lastParam < numParams) { >+ Class componentType = paramTypes[lastParam].getComponentType(); >+ Object varArgs = java.lang.reflect.Array.newInstance(componentType, numParams - lastParam); >+ for (int i = lastParam; i < numParams; i++) { >+ Object param = this.children[i].getValue(ctx); >+ java.lang.reflect.Array.set(varArgs, i - lastParam, coerceToType(param, componentType)); >+ } >+ params[lastParam] = varArgs; >+ } > } catch (ELException ele) { > throw new ELException(MessageFactory.get("error.function", this > .getOutputName()), ele);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 44294
:
21426
|
21567
|
21569
|
21570
|
21593