From: remm Date: Fri, 27 Apr 2007 22:00:40 +0000 (+0000) Subject: - Add an explicit check for null (it's there in the facades ...). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f0fa943a836e83312354ad515cdc52eee1846923;p=tomcat7.0 - Add an explicit check for null (it's there in the facades ...). git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@533239 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/connector/CometEventImpl.java b/java/org/apache/catalina/connector/CometEventImpl.java index 708f4f4c5..5a2670e53 100644 --- a/java/org/apache/catalina/connector/CometEventImpl.java +++ b/java/org/apache/catalina/connector/CometEventImpl.java @@ -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(); } diff --git a/java/org/apache/catalina/connector/LocalStrings.properties b/java/org/apache/catalina/connector/LocalStrings.properties index 20b3ba35e..e321cc00c 100644 --- a/java/org/apache/catalina/connector/LocalStrings.properties +++ b/java/org/apache/catalina/connector/LocalStrings.properties @@ -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