[ 
https://issues.apache.org/jira/browse/HDDS-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aravindan Vijayan updated HDDS-2510:
------------------------------------
    Summary: Use isEmpty() to check whether the collection is empty or not in 
Ozone Manager module  (was: Sonar : Use isEmpty() to check whether the 
collection is empty or not in Ozone Manager module)

> Use isEmpty() to check whether the collection is empty or not in Ozone 
> Manager module
> -------------------------------------------------------------------------------------
>
>                 Key: HDDS-2510
>                 URL: https://issues.apache.org/jira/browse/HDDS-2510
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Ozone Manager
>            Reporter: Aravindan Vijayan
>            Assignee: Aravindan Vijayan
>            Priority: Major
>              Labels: sonar
>
> Ozone Manager has a number of instances where the following sonar rule is 
> flagged.
> bq. 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(n).
> An example of a flagged instance - 
> https://sonarcloud.io/issues?myIssues=true&open=AW5md-W4KcVY8lQ4Zrv_&resolved=false



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to