Details
-
Bug
-
Status: Closed
-
Should
-
Resolution: Fixed
-
None
-
None
-
None
Description
There are ~40 checks for whether a collection is or is not empty using the Collection.size() and a less than or greater than 0.
It is cleaner to use the Collection.isEmpty()
Refer to sonar
https://ci.openmrs.org/sonar/drilldown/issues/1865?severity=CRITICAL
to find the related code.
The rule that is violated is "Collection.isEmpty() should be used to test for emptiness" which can be found under the severity critical.