CollectionUtils.size(Object object) has impossible null check
-------------------------------------------------------------

                 Key: COLLECTIONS-318
                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-318
             Project: Commons Collections
          Issue Type: Bug
            Reporter: Sebb
            Priority: Minor


CollectionUtils.size(Object object) has impossible null check:

{code}
    public static int size(Object object) {
        if (object == null) {
            return 0;
        }
...
        } else if (object == null) {
            throw new IllegalArgumentException("Unsupported object type: null");
...
{code}

The Javadoc specifically says that null is allowed, so I think the object == 
null clause needs to be removed - it can never be true, and is just confusing.


-- 
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