Major sonar issue in dashboard module
*Using collection.isEmpty() instead of collection.size()
makes code more readable and is more performant
Issue-Id: CCSDK-87
Change-Id: I201d1c7982ce6a1509a462d7d151a41ab2912f91
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
@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");