You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Stepan Koltsov (JIRA)" <ji...@apache.org> on 2006/10/30 00:33:16 UTC

[jira] Created: (COLLECTIONS-230) CollectionUtils.size(null) should return 0

CollectionUtils.size(null) should return 0
------------------------------------------

                 Key: COLLECTIONS-230
                 URL: http://issues.apache.org/jira/browse/COLLECTIONS-230
             Project: Commons Collections
          Issue Type: Wish
    Affects Versions: 3.2
            Reporter: Stepan Koltsov


Hello,

CollectionUtils.size(null) currently throws IllegalArgumentException("Unsupported object type: null"). I think CollectionUtils.size(null) should return 0.

Why?

The aim of library is to minimize the amount of code that uses this library. In my experience, in the most cases null collections can be threated as as zero-length. Current behavior causes the need of many trivial null-checks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org