This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new e1d9777158 Simplify code. Patch provided by Paolo B.
e1d9777158 is described below
commit e1d9777158d4a975f20a795a28b561d96b65c876
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Nov 7 14:54:56 2024 +0000
Simplify code. Patch provided by Paolo B.
---
java/org/apache/el/parser/AstMethodParameters.java | 9 +++------
webapps/docs/changelog.xml | 4 ++++
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/el/parser/AstMethodParameters.java
b/java/org/apache/el/parser/AstMethodParameters.java
index 4f5c78c5c9..034f186b36 100644
--- a/java/org/apache/el/parser/AstMethodParameters.java
+++ b/java/org/apache/el/parser/AstMethodParameters.java
@@ -17,9 +17,6 @@
/* Generated By:JJTree: Do not edit this line. AstDotSuffix.java */
package org.apache.el.parser;
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.el.lang.EvaluationContext;
public final class AstMethodParameters extends SimpleNode {
@@ -37,11 +34,11 @@ public final class AstMethodParameters extends SimpleNode {
if (numChildren == 0) {
return EMPTY_OBJECT_ARRAY;
}
- List<Object> params = new ArrayList<>();
+ Object[] params = new Object[numChildren];
for (int i = 0; i < numChildren; i++) {
- params.add(this.jjtGetChild(i).getValue(ctx));
+ params[i] = this.jjtGetChild(i).getValue(ctx);
}
- return params.toArray(EMPTY_OBJECT_ARRAY);
+ return params;
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5245961419..f4cd6af296 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -319,6 +319,10 @@
methods that do not accept any parameters. Patch provided by John
Engebretson. (markt)
</fix>
+ <fix>
+ Further optimise EL evaluation of method parameters. Patch provided by
+ Paolo B. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]