From cb7e5aa3c0445882a2bc04222573c1563b98117b Mon Sep 17 00:00:00 2001 From: "m.miernik" Date: Tue, 22 Jun 2021 11:37:46 +0200 Subject: Fix sonar issues Replaced methods size() to isEmpty() based on Sonar recommendations Issue-ID: SDNC-1568 Change-Id: I9b2548ba1d42e009a62ddd34f4f43452622c6ff0 Signed-off-by: m.miernik --- .../features/sdnr/wt/common/configuration/subtypes/SectionValue.java | 2 +- .../features/sdnr/wt/common/database/queries/BoolQueryBuilder.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sdnr/wt/common/src') diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/subtypes/SectionValue.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/subtypes/SectionValue.java index f513e011c..6715be1dc 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/subtypes/SectionValue.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/subtypes/SectionValue.java @@ -79,7 +79,7 @@ class SectionValue { public void removeComment(String comment) { this.comments.remove(comment); - this.isUncommented = this.comments.size()==0; + this.isUncommented = this.comments.isEmpty(); } public List getComments() { diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/queries/BoolQueryBuilder.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/queries/BoolQueryBuilder.java index 359b9d04b..83c08b270 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/queries/BoolQueryBuilder.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/queries/BoolQueryBuilder.java @@ -40,7 +40,7 @@ public class BoolQueryBuilder extends QueryBuilder { } public static boolean isEmpty(JSONObject o) { - return o.keySet().size() <= 0; + return o.keySet().isEmpty(); } public BoolQueryBuilder must(QueryBuilder query) { -- cgit 1.2.3-korg