Fix most of the warnings in this package
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 14 Sep 2010 07:55:26 +0000 (07:55 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 14 Sep 2010 07:55:26 +0000 (07:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@996780 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/AbstractInputBuffer.java
java/org/apache/coyote/http11/AbstractOutputBuffer.java
java/org/apache/coyote/http11/Http11NioProtocol.java
java/org/apache/coyote/http11/InputFilter.java
java/org/apache/coyote/http11/InternalAprInputBuffer.java
java/org/apache/coyote/http11/InternalAprOutputBuffer.java
java/org/apache/coyote/http11/InternalInputBuffer.java
java/org/apache/coyote/http11/InternalNioInputBuffer.java
java/org/apache/coyote/http11/InternalNioOutputBuffer.java
java/org/apache/coyote/http11/InternalOutputBuffer.java
java/org/apache/coyote/http11/OutputFilter.java

index f023fd2..c2ac664 100644 (file)
@@ -309,6 +309,7 @@ public abstract class AbstractInputBuffer implements InputBuffer{
     /**
      * Read some bytes.
      */
+    @Override
     public int doRead(ByteChunk chunk, Request req) 
         throws IOException {
 
index e5e8f89..d761128 100644 (file)
@@ -184,6 +184,7 @@ public abstract class AbstractOutputBuffer implements OutputBuffer{
      * @return number of bytes written
      * @throws IOException an underlying I/O error occurred
      */
+    @Override
     public int doWrite(ByteChunk chunk, Response res) 
         throws IOException {
 
@@ -367,6 +368,7 @@ public abstract class AbstractOutputBuffer implements OutputBuffer{
         if (org.apache.coyote.Constants.IS_SECURITY_ENABLED){
            AccessController.doPrivileged(
                 new PrivilegedAction<Void>(){
+                    @Override
                     public Void run(){
                         buf[pos++] = Constants.CR;
                         buf[pos++] = Constants.LF;
index 63fa912..62d92a4 100644 (file)
@@ -210,6 +210,7 @@ public class Http11NioProtocol extends AbstractHttp11JsseProtocol {
         protected ConcurrentHashMap<NioChannel, Http11NioProcessor> connections =
             new ConcurrentHashMap<NioChannel, Http11NioProcessor>();
         protected ConcurrentLinkedQueue<Http11NioProcessor> recycledProcessors = new ConcurrentLinkedQueue<Http11NioProcessor>() {
+            private static final long serialVersionUID = 1L;
             protected AtomicInteger size = new AtomicInteger(0);
             @Override
             public boolean offer(Http11NioProcessor processor) {
index c880e9c..94b7db1 100644 (file)
@@ -36,6 +36,7 @@ public interface InputFilter extends InputBuffer {
      * 
      * @return Number of bytes read.
      */
+    @Override
     public int doRead(ByteChunk chunk, Request unused)
         throws IOException;
 
index fafe13a..e7be699 100644 (file)
@@ -325,6 +325,7 @@ public class InternalAprInputBuffer extends AbstractInputBuffer {
         throws IOException {
 
         while (parseHeader()) {
+            // Loop until there are no more headers
         }
 
         parsingHeader = false;
@@ -339,6 +340,7 @@ public class InternalAprInputBuffer extends AbstractInputBuffer {
      * @return false after reading a blank line (which indicates that the
      * HTTP header parsing is done
      */
+    @SuppressWarnings("null") // headerValue cannot be null
     public boolean parseHeader()
         throws IOException {
 
@@ -446,6 +448,7 @@ public class InternalAprInputBuffer extends AbstractInputBuffer {
                 }
 
                 if (buf[pos] == Constants.CR) {
+                    // Skip
                 } else if (buf[pos] == Constants.LF) {
                     eol = true;
                 } else if (buf[pos] == Constants.SP) {
@@ -612,6 +615,7 @@ public class InternalAprInputBuffer extends AbstractInputBuffer {
         /**
          * Read bytes into the specified chunk.
          */
+        @Override
         public int doRead(ByteChunk chunk, Request req ) 
             throws IOException {
 
index 6cc44cc..84ebbe3 100644 (file)
@@ -247,6 +247,7 @@ public class InternalAprOutputBuffer extends AbstractOutputBuffer {
         /**
          * Write chunk.
          */
+        @Override
         public int doWrite(ByteChunk chunk, Response res) 
             throws IOException {
 
index 6a0c2bd..4ded3b1 100644 (file)
@@ -255,6 +255,7 @@ public class InternalInputBuffer extends AbstractInputBuffer {
         throws IOException {
 
         while (parseHeader()) {
+            // Loop until we run out of headers
         }
 
         parsingHeader = false;
@@ -269,6 +270,7 @@ public class InternalInputBuffer extends AbstractInputBuffer {
      * @return false after reading a blank line (which indicates that the
      * HTTP header parsing is done
      */
+    @SuppressWarnings("null") // headerValue cannot be null
     public boolean parseHeader()
         throws IOException {
 
@@ -376,6 +378,7 @@ public class InternalInputBuffer extends AbstractInputBuffer {
                 }
 
                 if (buf[pos] == Constants.CR) {
+                    // Skip
                 } else if (buf[pos] == Constants.LF) {
                     eol = true;
                 } else if (buf[pos] == Constants.SP) {
@@ -489,6 +492,7 @@ public class InternalInputBuffer extends AbstractInputBuffer {
         /**
          * Read bytes into the specified chunk.
          */
+        @Override
         public int doRead(ByteChunk chunk, Request req ) 
             throws IOException {
 
index e6c8f4f..125e1ac 100644 (file)
@@ -396,7 +396,11 @@ public class InternalNioInputBuffer extends AbstractInputBuffer {
         socket.getBufHandler().getReadBuffer().clear();
         if ( block ) {
             Selector selector = null;
-            try { selector = getSelectorPool().get(); }catch ( IOException x ) {}
+            try {
+                selector = getSelectorPool().get();
+            } catch ( IOException x ) {
+                // Ignore
+            }
             try {
                 NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
                 if ( att == null ) throw new IOException("Key must be cancelled.");
@@ -569,6 +573,7 @@ public class InternalNioInputBuffer extends AbstractInputBuffer {
                     }
 
                     if (buf[pos] == Constants.CR) {
+                        // Skip
                     } else if (buf[pos] == Constants.LF) {
                         eol = true;
                     } else if (buf[pos] == Constants.SP) {
@@ -706,6 +711,7 @@ public class InternalNioInputBuffer extends AbstractInputBuffer {
         /**
          * Read bytes into the specified chunk.
          */
+        @Override
         public int doRead(ByteChunk chunk, Request req ) 
             throws IOException {
 
index b64a06c..1db303f 100644 (file)
@@ -307,6 +307,7 @@ public class InternalNioOutputBuffer extends AbstractOutputBuffer {
         /**
          * Write chunk.
          */
+        @Override
         public int doWrite(ByteChunk chunk, Response res) 
             throws IOException {
 
index 501d04c..480fab9 100644 (file)
@@ -234,6 +234,7 @@ public class InternalOutputBuffer extends AbstractOutputBuffer
     /**
      * Callback to write data from the buffer.
      */
+    @Override
     public void realWriteBytes(byte cbuf[], int off, int len)
         throws IOException {
         if (len > 0) {
@@ -256,6 +257,7 @@ public class InternalOutputBuffer extends AbstractOutputBuffer
         /**
          * Write chunk.
          */
+        @Override
         public int doWrite(ByteChunk chunk, Response res) 
             throws IOException {
 
index 22bcc3e..83ab390 100644 (file)
@@ -36,6 +36,7 @@ public interface OutputFilter extends OutputBuffer {
      * 
      * @return number of bytes written by the filter
      */
+    @Override
     public int doWrite(ByteChunk chunk, Response unused)
         throws IOException;