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.

Reply via email to