You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Aravindan Vijayan (Jira)" <ji...@apache.org> on 2019/11/15 17:04:00 UTC
[jira] [Updated] (HDDS-2510) Sonar : Use isEmpty() to check whether
the collection is empty or not in Ozone Manager module
[ https://issues.apache.org/jira/browse/HDDS-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aravindan Vijayan updated HDDS-2510:
------------------------------------
Description:
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
was:
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
> Sonar : 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: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org