struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10738] New: - RequestProcessor Passes Null Reference to log.warn(...)
Date Fri, 12 Jul 2002 13:16:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10738>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10738

RequestProcessor Passes Null Reference to log.warn(...)

           Summary: RequestProcessor Passes Null Reference to log.warn(...)
           Product: Struts
           Version: 1.1 Beta 1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Unknown
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: glm@hilbertinc.com


At line 490 (beginning of the processException(...) method), the
getInternal().getMessage(...) returns a null reference, which is passed to the
log.warn(..) method.  The logger doesn't check for null references and throws a
null pointer reference, which obscures the original problem.

I changed the beginning of that method to check for the null reference as follows:

        // Is there a defined handler for this exception?
        ExceptionConfig config = mapping.findException(exception.getClass());
        if (config == null) {
            String message = getInternal().getMessage("unhandledException",    
                                                  
                                                      exception.getClass());
            if (null != message) {
               log.warn(message);
            }

P.S. I also opened a defect on the logger to tolerate null references.

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message