aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshashikanth <shashikanth.vh@huawei.com>2017-09-21 17:32:51 +0530
committershashikanth <shashikanth.vh@huawei.com>2017-09-21 17:32:51 +0530
commit593847a7c7671e5aedc7c465b65051a638465993 (patch)
treed3bd28abfe4bf9f0ccded845d05c1eba10d5583f
parent97662b28b1cfd66c167e6a13fbac1d1567780e10 (diff)
Fix Blocker/Critical sonar issues
Fix Blocker/Critical sonar issues in dashboard module https://sonar.onap.org/component_issues?id=org.onap.oom.dashboard%3Aoom-app-parent#resolved=false|severities=CRITICAL Fixed Use isEmpty() to check whether the collection is empty or not. Issue-Id: CCSDK-67 Change-Id: Ib4c04759eb80473232c83c617894ead892531b46 Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
-rw-r--r--oom-app-common/src/main/java/org/onap/oom/dashboard/controller/HealthCheckController.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/HealthCheckController.java b/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/HealthCheckController.java
index fe54790..7ed3fbe 100644
--- a/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/HealthCheckController.java
+++ b/oom-app-common/src/main/java/org/onap/oom/dashboard/controller/HealthCheckController.java
@@ -72,7 +72,7 @@ public class HealthCheckController extends UnRestrictedBaseController {
@SuppressWarnings("unchecked")
// Get the single app.
List<App> list = dataAccessService.getList(App.class, null);
- if (list.size() > 0)
+ if (!list.isEmpty())
healthStatus = new HealthStatus(200, SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME) + " health check succeeded");
else
healthStatus = new HealthStatus(500, SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME) + " health check failed to run db query");