- Add an explicit check for null (it's there in the facades ...).
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 27 Apr 2007 22:00:40 +0000 (22:00 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 27 Apr 2007 22:00:40 +0000 (22:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@533239 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/CometEventImpl.java
java/org/apache/catalina/connector/LocalStrings.properties

index 708f4f4..5a2670e 100644 (file)
@@ -25,10 +25,18 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.catalina.CometEvent;
+import org.apache.catalina.util.StringManager;
 
 public class CometEventImpl implements CometEvent {
 
 
+    /**
+     * The string manager for this package.
+     */
+    protected static StringManager sm =
+        StringManager.getManager(Constants.Package);
+
+
     public CometEventImpl(Request request, Response response) {
         this.request = request;
         this.response = response;
@@ -81,6 +89,9 @@ public class CometEventImpl implements CometEvent {
     }
     
     public void close() throws IOException {
+        if (request == null) {
+            throw new IllegalStateException(sm.getString("cometEvent.nullRequest"));
+        }
         request.setComet(false);
         response.finishResponse();
     }
index 20b3ba3..e321cc0 100644 (file)
@@ -23,6 +23,7 @@ coyoteConnector.protocolUnregistrationFailed=Protocol handler stop failed
 #
 
 coyoteAdapter.service=An exception or error occurred in the container during the request processing
+coyoteAdapter.read=The servlet did not read all available bytes during the processing of the read event
 
 #
 # CoyoteResponse
@@ -48,8 +49,9 @@ coyoteRequest.listenerStop=Exception sending context destroyed event to listener
 coyoteRequest.attributeEvent=Exception thrown by attributes event listener
 coyoteRequest.parseParameters=Exception thrown whilst processing POSTed parameters
 coyoteRequest.postTooLarge=Parameters were not parsed because the size of the posted data was too big. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
-requestFacade.nullRequest=Null request object
-responseFacade.nullResponse=Null response object
+requestFacade.nullRequest=The request object has been recycled and is no longer associated with this facade
+responseFacade.nullResponse=The response object has been recycled and is no longer associated with this facade
+cometEvent.nullRequest=The event object has been recycled and is no longer associated with a request
 
 #
 # MapperListener