From 03167d7e9486c1d201de9752e8e629f8654d31e0 Mon Sep 17 00:00:00 2001 From: ezhil Date: Fri, 7 Dec 2018 23:40:29 +0530 Subject: Sonar issues fix in SVcLogicPropertiesProviderImpl Fixed critical and minor issues Issue-ID: CCSDK-798 Change-Id: I86ae8741b3eda5729d2c6169d0342b585cea68ad Signed-off-by: ezhil --- .../core/sli/provider/SvcLogicPropertiesProviderImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProviderImpl.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProviderImpl.java index c4680cce..aad7a5a6 100644 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProviderImpl.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProviderImpl.java @@ -3,6 +3,7 @@ * onap * ================================================================================ * Copyright (C) 2016 - 2017 ONAP + * Modifications Copyright (C) 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,12 +25,10 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.net.URL; import java.util.Optional; import java.util.Properties; import java.util.Vector; -import org.onap.ccsdk.sli.core.dblib.DblibConfigurationException; import org.onap.ccsdk.sli.core.sli.ConfigurationException; import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicPropertiesProvider; import org.onap.ccsdk.sli.core.utils.JREFileResolver; @@ -57,7 +56,7 @@ import org.slf4j.LoggerFactory; */ public class SvcLogicPropertiesProviderImpl implements SvcLogicPropertiesProvider { - private static final Logger LOG = LoggerFactory.getLogger(SvcLogicPropertiesProviderImpl.class); + private static final Logger log = LoggerFactory.getLogger(SvcLogicPropertiesProviderImpl.class); /** * The name of the properties file for database configuration @@ -95,7 +94,7 @@ public class SvcLogicPropertiesProviderImpl implements SvcLogicPropertiesProvide properties = new Properties(); properties.load(fileInputStream); } catch (final IOException e) { - LOG.error("Failed to load properties for file: {}", propertiesFile.toString(), + log.error("Failed to load properties for file: {}", propertiesFile.toString(), new ConfigurationException("Failed to load properties for file: " + propertiesFile.toString(), e)); } @@ -109,6 +108,7 @@ public class SvcLogicPropertiesProviderImpl implements SvcLogicPropertiesProvide properties.load(propStr); propStr.close(); } catch (IOException e) { + log.error("IO Exception",e); properties = null; } } @@ -143,7 +143,7 @@ public class SvcLogicPropertiesProviderImpl implements SvcLogicPropertiesProvide private static File reportSuccess(final String message, final Optional fileOptional) { if (fileOptional.isPresent()) { final File file = fileOptional.get(); - LOG.info("{} {}", message, file.getPath()); + log.info("{} {}", message, file.getPath()); return file; } return null; @@ -160,7 +160,7 @@ public class SvcLogicPropertiesProviderImpl implements SvcLogicPropertiesProvide */ private static void reportFailure(final String message, final ConfigurationException configurationException) { - LOG.error("{}", message, configurationException); + log.error("{}", message, configurationException); } /** -- cgit 1.2.3-korg