tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Luehe <Jan.Lu...@Sun.COM>
Subject Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector RequestFacade.java LocalStrings.properties
Date Tue, 02 Nov 2004 03:25:43 GMT
Bill Barker wrote:
> ----- Original Message -----
> From: "Jan Luehe" <Jan.Luehe@Sun.COM>
> To: "Tomcat Developers List" <tomcat-dev@jakarta.apache.org>
> Sent: Monday, November 01, 2004 3:41 PM
> Subject: Re: cvs commit:
> jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector
> RequestFacade.java LocalStrings.properties
> 
> 
> 
>>Remy Maucherat wrote:
>>
>>>luehe@apache.org wrote:
>>>
>>>
>>>
>>>>luehe       2004/11/01 14:38:44
>>>>
>>>>Modified:    catalina/src/share/org/apache/catalina/connector
>>>>                      RequestFacade.java LocalStrings.properties
>>>>Log:
>>>>Throw more meaningful exception (instead of NPE) if underlying request
> 
> has been
> 
>>>>recycled and attempt is made to access it via its facade
>>>>
>>>
>>>I think I always consistently refused this change (no use: if people who
>>>hack can't be bothered to look that up in the code, then I don't think
>>>they'll understand what your exception really means either), but I'll
>>>give up on that one.
>>
>>In this case, it's useful because rather than instinctively filing a bug
>>against Tomcat when seeing a NPE, people will be reminded to check their
>>code first, because they're obviously using Tomcat in a way it was not
>>intended to be used.
>>
> 
> 
> I agree with Remy:  It's totally unnecessary, and gives somebody reading the
> code that the request can be null.  The javadocs should probably be updated
> with something like:
>   * @exception IllegalStateException If you are a total moron without a clue
> ;-)

In the case I was referring to, some project was storing a
servlet request (facade) in a ThreadLocal and, due to a bug in their
code, was hanging on to it beyond the request's lifetime. This was
happening only under rare circumstances.

So in this case, the Request behind the facade was indeed null.


Jan





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


Mime
View raw message