Author: mmillson
Date: 2010-08-05 15:11:28 -0400 (Thu, 05 Aug 2010)
New Revision: 1520
Modified:
branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/Request.java
Log:
Add null checks for [JBPAPP-4788].
Modified:
branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/Request.java
===================================================================
---
branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/Request.java 2010-08-05
19:00:25 UTC (rev 1519)
+++
branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/Request.java 2010-08-05
19:11:28 UTC (rev 1520)
@@ -1339,6 +1339,9 @@
return;
}
+ if (context == null)
+ return;
+
// Notify interested application event listeners
Object listeners[] = context.getApplicationEventListeners();
if ((listeners == null) || (listeners.length == 0))
@@ -1409,6 +1412,9 @@
coyoteRequest.setAttribute(name, value);
}
+ if (context == null)
+ return;
+
// Notify interested application event listeners
Object listeners[] = context.getApplicationEventListeners();
if ((listeners == null) || (listeners.length == 0))
@@ -2254,9 +2260,7 @@
return (session);
// Return the requested session if it exists and is valid
- Manager manager = null;
- if (context != null)
- manager = context.getManager();
+ Manager manager = context.getManager();
if (manager == null)
return (null); // Sessions are not supported
if (requestedSessionId != null) {
@@ -2276,7 +2280,7 @@
// Create a new session if requested and the response is not committed
if (!create)
return (null);
- if ((context != null) && (response != null) &&
+ if ((response != null) &&
context.getCookies() &&
response.getResponse().isCommitted()) {
throw new IllegalStateException
@@ -2294,8 +2298,7 @@
}
// Creating a new session cookie based on that session
- if ((session != null) && (getContext() != null)
- && getContext().getCookies()) {
+ if ( (session != null) && context.getCookies() ) {
Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
session.getIdInternal());
configureSessionCookie(cookie);
@@ -2401,6 +2404,9 @@
protected void parseParameters() {
parametersParsed = true;
+
+ if (context == null)
+ return;
Parameters parameters = coyoteRequest.getParameters();
Show replies by date