David Cooke (JIRA | 6 Jun 2008 16:44
Picon
Favicon

Created: (SHALE-494) WebResourceProcessor getResourceURL throws and catches NPE

WebResourceProcessor getResourceURL throws and catches NPE
----------------------------------------------------------

                 Key: SHALE-494
                 URL: https://issues.apache.org/struts/browse/SHALE-494
             Project: Shale
          Issue Type: Bug
          Components: Remoting
    Affects Versions: 1.0.4
         Environment: WinXP, glassfish v2ur1
            Reporter: David Cooke
            Priority: Minor

In the try catch block where the resource ID is converted to a URL using reflection, the code looks to see if
debug logging is enabled in order to log the conversion.  However, log is null at this point, causing an NPE
which is caught in the surrounding try/catch (there for reflection exceptions).  It is then logged as a
resource exception, and null is returned.  This seconds set of logging uses the log() private method which
assigns to the variable log.

            if (log.isDebugEnabled()) {
                log.debug("getResource(" + resourceId + ") --> " + url);
            }

should be

            if (log().isDebugEnabled()) {
                log().debug("getResource(" + resourceId + ") --> " + url);
            }

--

-- 
(Continue reading)


Gmane