Details
-
Wish
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2
-
None
-
None
Description
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.
Attachments
Issue Links
- is depended upon by
-
COLLECTIONS-297 Fix javadoc for Collections.size() with regard to null handling
- Closed
- relates to
-
COLLECTIONS-298 CollectionUtils.sizeIsEmpty(null) should return true
- Closed