tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1099575 - in /tomcat/trunk: java/org/apache/jasper/runtime/BodyContentImpl.java webapps/docs/changelog.xml
Date Wed, 04 May 2011 19:53:55 GMT
Author: markt
Date: Wed May  4 19:53:54 2011
New Revision: 1099575

URL: http://svn.apache.org/viewvc?rev=1099575&view=rev
Log:
Re-factor to try and determine if the root cause of https://issues.apache.org/bugzilla/show_bug.cgi?id=51124
is an OOME or something else.

Modified:
    tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java?rev=1099575&r1=1099574&r2=1099575&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java Wed May  4 19:53:54 2011
@@ -56,8 +56,8 @@ public class BodyContentImpl extends Bod
      */
     public BodyContentImpl(JspWriter enclosingWriter) {
         super(enclosingWriter);
-        bufferSize = Constants.DEFAULT_TAG_BUFFER_SIZE;
-        cb = new char[bufferSize];
+        cb = new char[Constants.DEFAULT_TAG_BUFFER_SIZE];
+        bufferSize = cb.length;
         nextChar = 0;
         closed = false;
     }
@@ -495,8 +495,8 @@ public class BodyContentImpl extends Bod
         } else {
             nextChar = 0;
             if (LIMIT_BUFFER && (cb.length > Constants.DEFAULT_TAG_BUFFER_SIZE))
{
-                bufferSize = Constants.DEFAULT_TAG_BUFFER_SIZE;
-                cb = new char[bufferSize];
+                cb = new char[Constants.DEFAULT_TAG_BUFFER_SIZE];
+                bufferSize = cb.length;
             }
         }
     }
@@ -644,13 +644,10 @@ public class BodyContentImpl extends Bod
             len = cb.length;
         }
         
-        bufferSize = cb.length + len;
-        char[] tmp = new char[bufferSize];
-        
+        char[] tmp = new char[cb.length + len];
         System.arraycopy(cb, 0, tmp, 0, cb.length);
         cb = tmp;
-        tmp = null;
-        
+        bufferSize = cb.length;
     }
     
     

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1099575&r1=1099574&r2=1099575&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed May  4 19:53:54 2011
@@ -172,6 +172,10 @@
         Use a single TLD location cache for a web application rather than one
         per JSP compilation to speed up JSP compilation. (markt)
       </update>
+      <add>
+        <bug>51124</bug>: Refactor BodyContentImpl to assist in determining the
+        root cause of this bug. Based on a patch by Ramiro. (markt)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Web applications">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message