On 11/06/2012 10:42, Konstantin Kolinko wrote:
> 2012/6/11  <ma...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to