summaryrefslogtreecommitdiffstats
path: root/lib/network-prioritization
diff options
context:
space:
mode:
Diffstat (limited to 'lib/network-prioritization')
-rw-r--r--lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/api/NpmServiceManagerImpl.java4
-rw-r--r--lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/utils/NpmUtils.java2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/api/NpmServiceManagerImpl.java b/lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/api/NpmServiceManagerImpl.java
index 2cdef3537..9016579bc 100644
--- a/lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/api/NpmServiceManagerImpl.java
+++ b/lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/api/NpmServiceManagerImpl.java
@@ -415,7 +415,9 @@ public class NpmServiceManagerImpl implements NpmServiceManager {
try {
logger.trace("Initializing NPM Configurations from:({})", configFilePath);
if (new File(configFilePath).exists()) {
- npmConfigurations.load(new FileInputStream(configFilePath));
+ try (FileInputStream configInputStream = new FileInputStream(configFilePath)) {
+ npmConfigurations.load(configInputStream);
+ }
} else {
logger.warn("Config File:({}) not found, Initializing NPM with default configurations.", configFilePath);
configFilePath = "properties" + File.separator + NpmConstants.NPM_CONFIG_PROPERTIES_FILE_NAME;
diff --git a/lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/utils/NpmUtils.java b/lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/utils/NpmUtils.java
index 735d6d91f..8b74e318b 100644
--- a/lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/utils/NpmUtils.java
+++ b/lib/network-prioritization/src/main/java/org/onap/ccsdk/features/lib/npm/utils/NpmUtils.java
@@ -61,7 +61,7 @@ public class NpmUtils {
mapper.enable(SerializationFeature.INDENT_OUTPUT);
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance);
} catch (JsonProcessingException e) {
- e.printStackTrace();
+ logger.warn(e.getMessage(), e);
}
return null;
}