This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 447e46c118 Fix BZ 69398. Avoid repeated allocation of empty arrays.
447e46c118 is described below

commit 447e46c11833f37f3eef1b48a8127e2db59711e8
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Oct 31 21:06:37 2024 +0000

    Fix BZ 69398. Avoid repeated allocation of empty arrays.
    
    Based on a suggestion by John Engebretson.
---
 java/org/apache/jasper/runtime/PageContextImpl.java |  7 +++----
 webapps/docs/changelog.xml                          | 13 +++++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/jasper/runtime/PageContextImpl.java 
b/java/org/apache/jasper/runtime/PageContextImpl.java
index b38ce953f4..6e0bb13138 100644
--- a/java/org/apache/jasper/runtime/PageContextImpl.java
+++ b/java/org/apache/jasper/runtime/PageContextImpl.java
@@ -67,6 +67,8 @@ public class PageContextImpl extends PageContext {
 
     private static final JspFactory jspf = JspFactory.getDefaultFactory();
 
+    private static final BodyContentImpl[] EMPTY_BODY_CONTENT_IMPL_ARRAY = new 
BodyContentImpl[0];
+
     private BodyContentImpl[] outs;
 
     private int depth;
@@ -104,11 +106,8 @@ public class PageContextImpl extends PageContext {
 
     private transient JspWriterImpl baseOut;
 
-    /*
-     * Constructor.
-     */
     PageContextImpl() {
-        this.outs = new BodyContentImpl[0];
+        this.outs = EMPTY_BODY_CONTENT_IMPL_ARRAY;
         this.attributes = new HashMap<>(16);
         this.depth = -1;
     }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 480c2d865d..7e67283949 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -255,6 +255,12 @@
         when using tag pooling, and to be skipped when not using it.
         Patch submitted by Michal Sobkiewicz. (remm)
       </fix>
+      <fix>
+        <bug>69381</bug>: Improve method lookup performance in expression
+        language. When the required method has no arguments there is no need to
+        consider casting or coercion and the method lookup process can be
+        simplified. Based on pull request <pr>770</pr> by John Engebretson.
+      </fix>
       <fix>
         <bug>69382</bug>: Improve the performance of the JSP include action by
         re-using results of relatively expensive method calls in the generated
@@ -262,10 +268,9 @@
         (markt)
       </fix>
       <fix>
-        <bug>69381</bug>: Improve method lookup performance in expression
-        language. When the required method has no arguments there is no need to
-        consider casting or coercion and the method lookup process can be
-        simplified. Based on pull request <pr>770</pr> by John Engebretson.
+        <bug>69398</bug>: Avoid unnecessary object allocation in
+        <code>PageContextImpl</code>. Based on a suggestion by John 
Engebretson.
+        (markt)
       </fix>
     </changelog>
   </subsection>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to