diff options
author | m.miernik <m.miernik@samsung.com> | 2021-06-22 11:37:46 +0200 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2021-06-23 15:48:40 +0000 |
commit | cb7e5aa3c0445882a2bc04222573c1563b98117b (patch) | |
tree | 54a754eb9a85890bddf3d05ae6787a6a6bd8e885 /sdnr/wt/helpserver/provider/src/main | |
parent | a285920200ba5cdff0d2df4f794518a0db395922 (diff) |
Fix sonar issues
Replaced methods size() to isEmpty() based on Sonar recommendations
Issue-ID: SDNC-1568
Change-Id: I9b2548ba1d42e009a62ddd34f4f43452622c6ff0
Signed-off-by: m.miernik <m.miernik@samsung.com>
Diffstat (limited to 'sdnr/wt/helpserver/provider/src/main')
-rw-r--r-- | sdnr/wt/helpserver/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/helpserver/data/HelpInfrastructureObject.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sdnr/wt/helpserver/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/helpserver/data/HelpInfrastructureObject.java b/sdnr/wt/helpserver/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/helpserver/data/HelpInfrastructureObject.java index ebf11b6af..35dbeec9f 100644 --- a/sdnr/wt/helpserver/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/helpserver/data/HelpInfrastructureObject.java +++ b/sdnr/wt/helpserver/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/helpserver/data/HelpInfrastructureObject.java @@ -72,7 +72,7 @@ public class HelpInfrastructureObject extends JSONObject { public static class NodeObject extends JSONObject { public NodeObject(Path base, File dir, String label, ArrayList<VersionObject> versions) { this.put("label", label); - if (versions != null && versions.size() > 0) { + if (versions != null && !versions.isEmpty()) { JSONObject o = new JSONObject(); this.put("versions", o); for (VersionObject version : versions) { @@ -87,7 +87,7 @@ public class HelpInfrastructureObject extends JSONObject { for (File f : list) { if (f.isDirectory()) { ArrayList<VersionObject> versions2 = findReadmeVersionFolders(base, f.toPath(), true); - if (versions2 != null && versions2.size() > 0) { + if (versions2 != null && !versions2.isEmpty()) { JSONObject nodes; if (!this.has("nodes")) { this.put("nodes", new JSONObject()); @@ -112,7 +112,7 @@ public class HelpInfrastructureObject extends JSONObject { for (File f : list) { if (f.isDirectory()) { ArrayList<VersionObject> versions = findReadmeVersionFolders(root.toPath(), f.toPath(), true); - if (versions != null && versions.size() > 0) { + if (versions != null && !versions.isEmpty()) { NodeObject o = new NodeObject(pRoot, f, f.getName(), versions); this.put(o.getString("label").toLowerCase(), o); } @@ -134,7 +134,7 @@ public class HelpInfrastructureObject extends JSONObject { } Collections.sort(list, VersionObject.getComparer()); Collections.reverse(list); - if (list.size() > 0 && appendCurrent) { + if (!list.isEmpty() && appendCurrent) { list.add(list.get(0).cloneAsCurrent()); } return list; |