tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1478862 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractInputBuffer.java LocalStrings.properties
Date Fri, 03 May 2013 16:21:07 GMT
Author: markt
Date: Fri May  3 16:21:06 2013
New Revision: 1478862

URL: http://svn.apache.org/r1478862
Log:
Another TODO.
Inputs are never null.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java
    tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java?rev=1478862&r1=1478861&r2=1478862&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java Fri May  3 16:21:06
2013
@@ -166,10 +166,14 @@ public abstract class AbstractInputBuffe
 
     /**
      * Add an input filter to the filter library.
+     *
+     * @throws NullPointerException if the supplied filter is null
      */
     public void addFilter(InputFilter filter) {
 
-        // FIXME: Check for null ?
+        if (filter == null) {
+            throw new NullPointerException(sm.getString("iib.filter.npe"));
+        }
 
         InputFilter[] newFilterLibrary =
             new InputFilter[filterLibrary.length + 1];
@@ -180,7 +184,6 @@ public abstract class AbstractInputBuffe
         filterLibrary = newFilterLibrary;
 
         activeFilters = new InputFilter[filterLibrary.length];
-
     }
 
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties?rev=1478862&r1=1478861&r2=1478862&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Fri May  3 16:21:06
2013
@@ -27,6 +27,7 @@ http11processor.sendfile.error=Error sen
 http11Processor.upgrade=An internal error has occurred as upgraded connections should only
be processed by the dedicated upgrade processor implementations
 
 iib.eof.error=Unexpected EOF read on the socket
+iib.filter.npe=You may not add a null filter
 iib.invalidheader=The HTTP header line [{0}] does not conform to RFC 2616 and has been ignored.
 iib.invalidmethod=Invalid character (CR or LF) found in method name
 iib.parseheaders.ise.error=Unexpected state: headers already parsed. Buffer not recycled?



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


Mime
View raw message