tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Speed <psp...@progeeks.com>
Subject Re: org.apache.core.ContextManager bug report
Date Thu, 24 Aug 2000 15:34:06 GMT


Chris Audley wrote:
> 
> in org.apache.core.ContextManager at line 978, the code in 3.2b2 assumes
> that an IOException is going to have a non-null message.  If the IOException
> contains a null, the code throws a NullPointerException
> 
>     if( ((IOException)t).getMessage().equals("Broken pipe"))
>         return;
> 
> I'd suggest something like
> 
>     String msg = t.getMessage()
>     if( msg != null && msg.equals("Broken pipe"))
>         return;

	Or another pretty decent idiom in these cases is to flip
the equals around like this:

     if( "Broken pipe".equals(((IOException)t).getMessage()) )
         return;

	Just my $0.02,
	-Paul

> 
> Cheers
> 
> Chris Audley
> Urbanfetch.com
> 
> ---------------------------------------------------------------------
> 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