commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Closed: (COLLECTIONS-318) CollectionUtils.size(Object object) has impossible null check
Date Thu, 23 Apr 2009 02:39:47 GMT

     [ https://issues.apache.org/jira/browse/COLLECTIONS-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Henri Yandell closed COLLECTIONS-318.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.4

svn ci -m "Removing unnecessary null check per COLLECTIONS-318" src
Sending        src/java/org/apache/commons/collections/CollectionUtils.java
Transmitting file data .
Committed revision 767767.

> 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
>          Components: Collection
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: 3.4
>
>
> 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