From ffcc9dc691833d40df7f3d2aea75b1c071d139b7 Mon Sep 17 00:00:00 2001 From: dekstroza Date: Wed, 2 May 2018 15:59:35 +0100 Subject: Fixes several sonarqube reported issues Fixes couple of major sonar reported issues, code is reformatted using ONAP java code style Issue-ID: SDC-1270 Change-Id: I8ae52deac5cf73eaedb0f104d72e5f4446239c6a Signed-off-by: dekstroza --- .../main/java/org/onap/config/impl/ConfigurationChangeNotifier.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationChangeNotifier.java') diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationChangeNotifier.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationChangeNotifier.java index a7c10caae9..015634b1cd 100644 --- a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationChangeNotifier.java +++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationChangeNotifier.java @@ -204,7 +204,7 @@ public final class ConfigurationChangeNotifier { List notificationList = store.get(tenant + Constants.KEY_ELEMENTS_DELEMETER + component); if (notificationList == null) { - notificationList = Collections.synchronizedList(new ArrayList()); + notificationList = Collections.synchronizedList(new ArrayList<>()); store.put(tenant + Constants.KEY_ELEMENTS_DELEMETER + component, notificationList); executor.scheduleWithFixedDelay( () -> triggerScanning(tenant + Constants.KEY_ELEMENTS_DELEMETER + component), 1, 30000, @@ -263,11 +263,11 @@ public final class ConfigurationChangeNotifier { private Set watchForChange(String location) throws Exception { if (location == null || location.trim().length() == 0) { - return null; + return Collections.emptySet(); } File file = new File(location); if (!file.exists()) { - return null; + return Collections.emptySet(); } Path path = file.toPath(); Set toReturn = new HashSet<>(); -- cgit 1.2.3-korg