Bill Barker wrote:
> ----- Original Message -----
> From: "Jan Luehe" <[EMAIL PROTECTED]>
> To: "Tomcat Developers List" <[EMAIL PROTECTED]>
> 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:
>>
>>>[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to