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 2015/01/09 10:43:28 UTC

svn commit: r1650467 - in /tomcat/trunk: java/org/apache/coyote/ java/org/apache/coyote/ajp/ java/org/apache/coyote/http11/ java/org/apache/coyote/http11/filters/ java/org/apache/coyote/spdy/ test/org/apache/coyote/http11/filters/

Author: markt
Date: Fri Jan  9 09:43:27 2015
New Revision: 1650467

URL: http://svn.apache.org/r1650467
Log:
Remove parameter that was being passed around but never used because in the few places it was used, it was already available as a field.

Modified:
    tomcat/trunk/java/org/apache/coyote/OutputBuffer.java
    tomcat/trunk/java/org/apache/coyote/Response.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java
    tomcat/trunk/java/org/apache/coyote/http11/OutputFilter.java
    tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
    tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java
    tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java
    tomcat/trunk/java/org/apache/coyote/http11/filters/VoidOutputFilter.java
    tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java
    tomcat/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java
    tomcat/trunk/test/org/apache/coyote/http11/filters/TesterOutputBuffer.java

Modified: tomcat/trunk/java/org/apache/coyote/OutputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/OutputBuffer.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/OutputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/OutputBuffer.java Fri Jan  9 09:43:27 2015
@@ -34,15 +34,13 @@ public interface OutputBuffer {
      * Write the given data to the response. The caller owns the chunks.
      *
      * @param chunk data to write
-     * @param response used to allow buffers that can be shared by multiple
-     *          responses.
      *
      * @return The number of bytes written which may be less than available in
      *         the input chunk
      *
      * @throws IOException an underlying I/O error occurred
      */
-    public int doWrite(ByteChunk chunk, Response response) throws IOException;
+    public int doWrite(ByteChunk chunk) throws IOException;
 
 
     /**

Modified: tomcat/trunk/java/org/apache/coyote/Response.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Response.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/Response.java (original)
+++ tomcat/trunk/java/org/apache/coyote/Response.java Fri Jan  9 09:43:27 2015
@@ -493,10 +493,8 @@ public final class Response {
     /**
      * Write a chunk of bytes.
      */
-    public void doWrite(ByteChunk chunk/*byte buffer[], int pos, int count*/)
-        throws IOException
-    {
-        outputBuffer.doWrite(chunk, this);
+    public void doWrite(ByteChunk chunk) throws IOException {
+        outputBuffer.doWrite(chunk);
         contentWritten+=chunk.getLength();
     }
 

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Fri Jan  9 09:43:27 2015
@@ -38,7 +38,6 @@ import org.apache.coyote.InputBuffer;
 import org.apache.coyote.OutputBuffer;
 import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
-import org.apache.coyote.Response;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -1621,11 +1620,8 @@ public class AjpProcessor<S> extends Abs
      */
     protected class SocketOutputBuffer implements OutputBuffer {
 
-        /**
-         * Write chunk.
-         */
         @Override
-        public int doWrite(ByteChunk chunk, Response res) throws IOException {
+        public int doWrite(ByteChunk chunk) throws IOException {
 
             if (!response.isCommitted()) {
                 // Validate and write response headers

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java Fri Jan  9 09:43:27 2015
@@ -204,7 +204,7 @@ public class Http11OutputBuffer implemen
     // --------------------------------------------------- OutputBuffer Methods
 
     @Override
-    public int doWrite(ByteChunk chunk, Response res) throws IOException {
+    public int doWrite(ByteChunk chunk) throws IOException {
 
         if (!committed) {
             // Send the connector a request for commit. The connector should
@@ -214,9 +214,9 @@ public class Http11OutputBuffer implemen
         }
 
         if (lastActiveFilter == -1) {
-            return outputStreamOutputBuffer.doWrite(chunk, res);
+            return outputStreamOutputBuffer.doWrite(chunk);
         } else {
-            return activeFilters[lastActiveFilter].doWrite(chunk, res);
+            return activeFilters[lastActiveFilter].doWrite(chunk);
         }
     }
 
@@ -612,7 +612,7 @@ public class Http11OutputBuffer implemen
          * Write chunk.
          */
         @Override
-        public int doWrite(ByteChunk chunk, Response res) throws IOException {
+        public int doWrite(ByteChunk chunk) throws IOException {
             int len = chunk.getLength();
             int start = chunk.getStart();
             byte[] b = chunk.getBuffer();

Modified: tomcat/trunk/java/org/apache/coyote/http11/OutputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/OutputFilter.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/OutputFilter.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/OutputFilter.java Fri Jan  9 09:43:27 2015
@@ -21,7 +21,6 @@ import java.io.IOException;
 
 import org.apache.coyote.OutputBuffer;
 import org.apache.coyote.Response;
-import org.apache.tomcat.util.buf.ByteChunk;
 
 /**
  * Output filter.
@@ -32,16 +31,6 @@ public interface OutputFilter extends Ou
 
 
     /**
-     * Write some bytes.
-     *
-     * @return number of bytes written by the filter
-     */
-    @Override
-    public int doWrite(ByteChunk chunk, Response unused)
-        throws IOException;
-
-
-    /**
      * Some filters need additional parameters from the response. All the
      * necessary reading can occur in that method, as this method is called
      * after the response header processing is complete.

Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java Fri Jan  9 09:43:27 2015
@@ -88,14 +88,8 @@ public class ChunkedOutputFilter impleme
 
     // --------------------------------------------------- OutputBuffer Methods
 
-
-    /**
-     * Write some bytes.
-     *
-     * @return number of bytes written by the filter
-     */
     @Override
-    public int doWrite(ByteChunk chunk, Response res)
+    public int doWrite(ByteChunk chunk)
         throws IOException {
 
         int result = chunk.getLength();
@@ -113,12 +107,12 @@ public class ChunkedOutputFilter impleme
             chunkLength[pos--] = HexUtils.getHex(digit);
         }
         chunkHeader.setBytes(chunkLength, pos + 1, 9 - pos);
-        buffer.doWrite(chunkHeader, res);
+        buffer.doWrite(chunkHeader);
 
-        buffer.doWrite(chunk, res);
+        buffer.doWrite(chunk);
 
         chunkHeader.setBytes(chunkLength, 8, 2);
-        buffer.doWrite(chunkHeader, res);
+        buffer.doWrite(chunkHeader);
 
         return result;
 
@@ -163,7 +157,7 @@ public class ChunkedOutputFilter impleme
         throws IOException {
 
         // Write end chunk
-        buffer.doWrite(END_CHUNK, null);
+        buffer.doWrite(END_CHUNK);
 
         return 0;
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/GzipOutputFilter.java Fri Jan  9 09:43:27 2015
@@ -62,15 +62,8 @@ public class GzipOutputFilter implements
 
     // --------------------------------------------------- OutputBuffer Methods
 
-
-    /**
-     * Write some bytes.
-     *
-     * @return number of bytes written by the filter
-     */
     @Override
-    public int doWrite(ByteChunk chunk, Response res)
-        throws IOException {
+    public int doWrite(ByteChunk chunk) throws IOException {
         if (compressionStream == null) {
             compressionStream = new GZIPOutputStream(fakeOutputStream, true);
         }
@@ -166,13 +159,13 @@ public class GzipOutputFilter implements
             // compatibility with Sun JDK 1.4.0
             singleByteBuffer[0] = (byte) (b & 0xff);
             outputChunk.setBytes(singleByteBuffer, 0, 1);
-            buffer.doWrite(outputChunk, null);
+            buffer.doWrite(outputChunk);
         }
         @Override
         public void write(byte[] b, int off, int len)
             throws IOException {
             outputChunk.setBytes(b, off, len);
-            buffer.doWrite(outputChunk, null);
+            buffer.doWrite(outputChunk);
         }
         @Override
         public void flush() throws IOException {/*NOOP*/}

Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java Fri Jan  9 09:43:27 2015
@@ -55,15 +55,8 @@ public class IdentityOutputFilter implem
 
     // --------------------------------------------------- OutputBuffer Methods
 
-
-    /**
-     * Write some bytes.
-     *
-     * @return number of bytes written by the filter
-     */
     @Override
-    public int doWrite(ByteChunk chunk, Response res)
-        throws IOException {
+    public int doWrite(ByteChunk chunk) throws IOException {
 
         int result = -1;
 
@@ -81,7 +74,7 @@ public class IdentityOutputFilter implem
                 } else {
                     remaining = remaining - result;
                 }
-                buffer.doWrite(chunk, res);
+                buffer.doWrite(chunk);
             } else {
                 // No more bytes left to be written : return -1 and clear the
                 // buffer
@@ -90,7 +83,7 @@ public class IdentityOutputFilter implem
             }
         } else {
             // If no content length was set, just write the bytes
-            buffer.doWrite(chunk, res);
+            buffer.doWrite(chunk);
             result = chunk.getLength();
         }
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/VoidOutputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/VoidOutputFilter.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/filters/VoidOutputFilter.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/VoidOutputFilter.java Fri Jan  9 09:43:27 2015
@@ -35,18 +35,9 @@ public class VoidOutputFilter implements
 
     // --------------------------------------------------- OutputBuffer Methods
 
-
-    /**
-     * Write some bytes.
-     *
-     * @return number of bytes written by the filter
-     */
     @Override
-    public int doWrite(ByteChunk chunk, Response res)
-        throws IOException {
-
+    public int doWrite(ByteChunk chunk) throws IOException {
         return chunk.getLength();
-
     }
 
 

Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java Fri Jan  9 09:43:27 2015
@@ -33,7 +33,6 @@ import org.apache.coyote.InputBuffer;
 import org.apache.coyote.OutputBuffer;
 import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
-import org.apache.coyote.Response;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.spdy.SpdyConnection;
@@ -124,8 +123,7 @@ public class SpdyProcessor<S> extends Ab
         long byteCount;
 
         @Override
-        public int doWrite(org.apache.tomcat.util.buf.ByteChunk chunk,
-                Response response) throws IOException {
+        public int doWrite(org.apache.tomcat.util.buf.ByteChunk chunk) throws IOException {
             if (!response.isCommitted()) {
 
                 // Send the connector a request for commit. The connector should

Modified: tomcat/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java Fri Jan  9 09:43:27 2015
@@ -63,7 +63,7 @@ public class TestGzipOutputFilter {
         ByteChunk chunk = new ByteChunk(1024);
         byte[] d = "Hello there tomcat developers, there is a bug in JDK".getBytes();
         chunk.append(d, 0, d.length);
-        tob.doWrite(chunk, res);
+        tob.doWrite(chunk);
 
         // flush the InternalOutputBuffer
         tob.flush();

Modified: tomcat/trunk/test/org/apache/coyote/http11/filters/TesterOutputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/filters/TesterOutputBuffer.java?rev=1650467&r1=1650466&r2=1650467&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/filters/TesterOutputBuffer.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/filters/TesterOutputBuffer.java Fri Jan  9 09:43:27 2015
@@ -101,11 +101,8 @@ public class TesterOutputBuffer extends
      */
     protected class OutputStreamOutputBuffer implements OutputBuffer {
 
-        /**
-         * Write chunk.
-         */
         @Override
-        public int doWrite(ByteChunk chunk, Response res) throws IOException {
+        public int doWrite(ByteChunk chunk) throws IOException {
             int length = chunk.getLength();
             outputStream.write(chunk.getBuffer(), chunk.getStart(), length);
             byteCount += chunk.getLength();



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