You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/04/28 15:32:03 UTC

svn commit: r769392 - in /tomcat/tc6.0.x/trunk: ./ STATUS.txt java/org/apache/jasper/runtime/BodyContentImpl.java webapps/docs/changelog.xml

Author: markt
Date: Tue Apr 28 13:32:02 2009
New Revision: 769392

URL: http://svn.apache.org/viewvc?rev=769392&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46354
ArrayIndexOutOfBoundsException when using org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
Pathc provided by Konstantin Kolinko

Modified:
    tomcat/tc6.0.x/trunk/   (props changed)
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 28 13:32:02 2009
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,718360,719119,719124,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,747834,747863,748344,750258,750291,750921,751286-751287,751295,757774,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763302,763599,768335
+/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,718360,719119,719124,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,747834,747863,748344,750258,750291,750921,751286-751287,751295,757774,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763302,763599,763681,768335

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=769392&r1=769391&r2=769392&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Apr 28 13:32:02 2009
@@ -146,13 +146,6 @@
   +1: markt, rjung
   -1: 
 
-* Fix http://svn.apache.org/viewvc?rev=763681&view=rev
-  ArrayIndexOutOfBoundsException when using
-  org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
-  Patch provided by Konstantin Kolinko
-  +1: markt, remm, rjung
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42579
   Handle both relative and absolute search results
   Patch provided by Brandon DuRette

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java?rev=769392&r1=769391&r2=769392&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java Tue Apr 28 13:32:02 2009
@@ -51,9 +51,6 @@
     // Enclosed writer to which any output is written
     private Writer writer;
     
-    // See comment in setWriter()
-    private int bufferSizeSave;
-    
     /**
      * Constructor.
      */
@@ -508,6 +505,19 @@
     }
     
     /**
+     * This method returns the size of the buffer used by the JspWriter.
+     *
+     * @return the size of the buffer in bytes, or 0 is unbuffered.
+     */
+    public int getBufferSize() {
+        // According to the spec, the JspWriter returned by 
+        // JspContext.pushBody(java.io.Writer writer) must behave as
+        // though it were unbuffered. This means that its getBufferSize()
+        // must always return 0.
+        return (writer == null) ? bufferSize : 0;
+    }
+    
+    /**
      * @return the number of bytes unused in the buffer
      */
     public int getRemaining() {
@@ -558,22 +568,7 @@
     void setWriter(Writer writer) {
         this.writer = writer;
         closed = false;
-        if (writer != null) {
-            // According to the spec, the JspWriter returned by 
-            // JspContext.pushBody(java.io.Writer writer) must behave as
-            // though it were unbuffered. This means that its getBufferSize()
-            // must always return 0. The implementation of
-            // JspWriter.getBufferSize() returns the value of JspWriter's
-            // 'bufferSize' field, which is inherited by this class. 
-            // Therefore, we simply save the current 'bufferSize' (so we can 
-            // later restore it should this BodyContentImpl ever be reused by
-            // a call to PageContext.pushBody()) before setting it to 0.
-            if (bufferSize != 0) {
-                bufferSizeSave = bufferSize;
-                bufferSize = 0;
-            }
-        } else {
-            bufferSize = bufferSizeSave;
+        if (writer == null) {
             clearBody();
         }
     }

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=769392&r1=769391&r2=769392&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Tue Apr 28 13:32:02 2009
@@ -99,6 +99,11 @@
         <bug>41606</bug>: Prevent double initialisation of JSPs. Patch provided
         by Chris Halstead. (markt)
       </fix>
+      <fix>
+        <bug>46354</bug>: ArrayIndexOutOfBoundsException when using
+        org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
+        Patch provided by Konstantin Kolinko. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Cluster">



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