Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
Ozone Manager has a number of instances where the following sonar rule is flagged.
Using Collection.size() to test for emptiness works, but using Collection.isEmpty() makes the code more readable and can be more performant. The time complexity of any isEmpty() method implementation should be O(1) whereas some implementations of size() can be O.
An example of a flagged instance - https://sonarcloud.io/issues?myIssues=true&open=AW5md-W4KcVY8lQ4Zrv_&resolved=false
Attachments
Issue Links
- links to