This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 32cff73576 Fix BZ 69398. Avoid repeated allocation of empty arrays.
32cff73576 is described below
commit 32cff73576ba7b3a4d598ce84b366ed09c0a002b
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 +++----
1 file changed, 3 insertions(+), 4 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;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]