From 92c4cc767e00c9b19938229f3ee682f873cdafa6 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 21 Jun 2010 11:54:13 +0000 Subject: [PATCH] Fix Eclipse warnings in this package. No functional change. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@956537 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/coyote/http11/filters/BufferedInputFilter.java | 8 ++++---- java/org/apache/coyote/http11/filters/ChunkedInputFilter.java | 3 +++ java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java | 2 ++ java/org/apache/coyote/http11/filters/GzipOutputFilter.java | 5 +++-- .../org/apache/coyote/http11/filters/SavedRequestInputFilter.java | 1 + java/org/apache/coyote/http11/filters/VoidInputFilter.java | 3 +++ java/org/apache/coyote/http11/filters/VoidOutputFilter.java | 2 ++ 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/java/org/apache/coyote/http11/filters/BufferedInputFilter.java b/java/org/apache/coyote/http11/filters/BufferedInputFilter.java index 879553147..cb7ed665f 100644 --- a/java/org/apache/coyote/http11/filters/BufferedInputFilter.java +++ b/java/org/apache/coyote/http11/filters/BufferedInputFilter.java @@ -89,11 +89,11 @@ public class BufferedInputFilter implements InputFilter { public int doRead(ByteChunk chunk, Request request) throws IOException { if (hasRead || buffered.getLength() <= 0) { return -1; - } else { - chunk.setBytes(buffered.getBytes(), buffered.getStart(), - buffered.getLength()); - hasRead = true; } + + chunk.setBytes(buffered.getBytes(), buffered.getStart(), + buffered.getLength()); + hasRead = true; return chunk.getLength(); } diff --git a/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java b/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java index 7e488f26c..1e4bfc5da 100644 --- a/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java +++ b/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java @@ -176,6 +176,7 @@ public class ChunkedInputFilter implements InputFilter { * Read the content length from the request. */ public void setRequest(Request request) { + // NOOP: Request isn't used so ignore it } @@ -187,6 +188,7 @@ public class ChunkedInputFilter implements InputFilter { // Consume extra bytes : parse the stream until the end chunk is found while (doRead(readChunk, null) >= 0) { + // NOOP: Just consume the input } // Return the number of extra bytes which were consumed @@ -275,6 +277,7 @@ public class ChunkedInputFilter implements InputFilter { } if (buf[pos] == Constants.CR) { + // FIXME: Improve parsing to check for CRLF } else if (buf[pos] == Constants.LF) { eol = true; } else if (buf[pos] == Constants.SEMI_COLON) { diff --git a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java index e0b18e3bf..650781d69 100644 --- a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java +++ b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java @@ -142,6 +142,7 @@ public class ChunkedOutputFilter implements OutputFilter { * after the response header processing is complete. */ public void setResponse(Response response) { + // NOOP: No need for parameters from response in this filter } @@ -172,6 +173,7 @@ public class ChunkedOutputFilter implements OutputFilter { * Make the filter ready to process the next request. */ public void recycle() { + // NOOP: Nothing to recycle } diff --git a/java/org/apache/coyote/http11/filters/GzipOutputFilter.java b/java/org/apache/coyote/http11/filters/GzipOutputFilter.java index 900666205..01873db5a 100644 --- a/java/org/apache/coyote/http11/filters/GzipOutputFilter.java +++ b/java/org/apache/coyote/http11/filters/GzipOutputFilter.java @@ -99,6 +99,7 @@ public class GzipOutputFilter implements OutputFilter { * after the response header processing is complete. */ public void setResponse(Response response) { + // NOOP: No need for parameters from response in this filter } @@ -166,9 +167,9 @@ public class GzipOutputFilter implements OutputFilter { buffer.doWrite(outputChunk, null); } @Override - public void flush() throws IOException {} + public void flush() throws IOException {/*NOOP*/} @Override - public void close() throws IOException {} + public void close() throws IOException {/*NOOP*/} } diff --git a/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java b/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java index 60aef9a6e..d6b2eda04 100644 --- a/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java +++ b/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java @@ -91,6 +91,7 @@ public class SavedRequestInputFilter implements InputFilter { * Set the next buffer in the filter pipeline (has no effect). */ public void setBuffer(InputBuffer buffer) { + // NOOP since this filter will be providing the request body } /** diff --git a/java/org/apache/coyote/http11/filters/VoidInputFilter.java b/java/org/apache/coyote/http11/filters/VoidInputFilter.java index 5d1c0c203..dec7fe6d4 100644 --- a/java/org/apache/coyote/http11/filters/VoidInputFilter.java +++ b/java/org/apache/coyote/http11/filters/VoidInputFilter.java @@ -75,6 +75,7 @@ public class VoidInputFilter implements InputFilter { * Set the associated request. */ public void setRequest(Request request) { + // NOOP: Request isn't used so ignore it } @@ -82,6 +83,7 @@ public class VoidInputFilter implements InputFilter { * Set the next buffer in the filter pipeline. */ public void setBuffer(InputBuffer buffer) { + // NOOP: No body to read } @@ -89,6 +91,7 @@ public class VoidInputFilter implements InputFilter { * Make the filter ready to process the next request. */ public void recycle() { + // NOOP: Nothing to recycle } diff --git a/java/org/apache/coyote/http11/filters/VoidOutputFilter.java b/java/org/apache/coyote/http11/filters/VoidOutputFilter.java index 72569c598..5a3d3535d 100644 --- a/java/org/apache/coyote/http11/filters/VoidOutputFilter.java +++ b/java/org/apache/coyote/http11/filters/VoidOutputFilter.java @@ -83,6 +83,7 @@ public class VoidOutputFilter implements OutputFilter { * after the response header processing is complete. */ public void setResponse(Response response) { + // NOOP: No need for parameters from response in this filter } @@ -98,6 +99,7 @@ public class VoidOutputFilter implements OutputFilter { * Make the filter ready to process the next request. */ public void recycle() { + // NOOP: Nothing to recycle } -- 2.11.0