Skip to content

Latest commit

 

History

History
8 lines (6 loc) · 381 Bytes

UseCollectionIsEmpty.md

File metadata and controls

8 lines (6 loc) · 381 Bytes

UseCollectionIsEmpty

Category: pmd
Rule Key: pmd:UseCollectionIsEmpty

⚠️ This rule is deprecated in favour of S1155.


The isEmpty() method on java.util.Collection is provided to see if a collection has any elements. Comparing the value of size() to 0 merely duplicates existing behavior.