tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r1348772 - /tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
Date Mon, 11 Jun 2012 09:45:04 GMT
On 11/06/2012 10:42, Konstantin Kolinko wrote:
> 2012/6/11  <markt@apache.org>:
>> Author: markt
>> Date: Mon Jun 11 09:37:00 2012
>> New Revision: 1348772
>>
>> URL: http://svn.apache.org/viewvc?rev=1348772&view=rev
>> Log:
>> Throwable.getMessage() might be null
>>
>> Modified:
>>    tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
>>
>> Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
>> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?rev=1348772&r1=1348771&r2=1348772&view=diff
>> ==============================================================================
>> --- tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java (original)
>> +++ tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Mon Jun 11
09:37:00 2012
>> @@ -140,10 +140,9 @@ public class ErrorReportValve extends Va
>>         }
>>
>>         String message = RequestUtil.filter(response.getMessage());
>> -        if (message == null) {
>> -            if (throwable != null) {
>> -                message = RequestUtil.filter(throwable.getMessage());
>> -            } else {
>> +        if (message == null && throwable != null) {
>> +            message = RequestUtil.filter(throwable.getMessage());
>> +            if (message == null) {
>>                 message = "";
>>             }
>>         }
> 
> Huh. Still a miss.
> The old logic before fixing this bug was:
>         String message = RequestUtil.filter(response.getMessage());
>         if (message == null) {
>             message = "";
>         }
> 
> So resulting message was never null.
> In your code it will be null when message and throwable are both null.

Grrr. This is going to be one of those really simple bugs that takes me
20+ attempts to get right.

Third attempt coming up.

Mark

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


Mime
View raw message