commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Dillard (JIRA)" <j...@apache.org>
Subject [jira] Created: (DIGESTER-121) Possible null pointer dereference in CallMethodRule.end()
Date Fri, 28 Mar 2008 14:44:24 GMT
Possible null pointer dereference in CallMethodRule.end()
---------------------------------------------------------

                 Key: DIGESTER-121
                 URL: https://issues.apache.org/jira/browse/DIGESTER-121
             Project: Commons Digester
          Issue Type: Improvement
    Affects Versions: 1.8
            Reporter: David Dillard
            Priority: Trivial


Here's part of the code for the end() method (I've removed the comments):

        } else if (paramTypes != null && paramTypes.length != 0) {
            if (bodyText == null) {
                return;
            }

            parameters = new Object[1];
            parameters[0] = bodyText;
            if (paramTypes.length == 0) {
                paramTypes = new Class[1];
                paramTypes[0] = String.class;
            }

        } else {
            ;
        }

        Object paramValues[] = new Object[paramTypes.length];


In the first line of the above code paramTypes is checked to make sure that it's not null,
implying it could be null.  However, in the last line of the above code paramTypes is assumed
to be non-null.  So, either an additional check is necessary or the testing of paramTypes
being null in the beginning isn't necessary.


This was detected by FindBugs.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message