commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Created: (COLLECTIONS-318) CollectionUtils.size(Object object) has impossible null check
Date Mon, 16 Feb 2009 19:30:02 GMT
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.


Mime
View raw message