aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDmitry Puzikov <d.puzikov2@partner.samsung.com>2019-11-13 16:52:25 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-11-17 14:17:17 +0000
commitf9b702bbe6cc958b16aaaf983cdd4d6d93b818fd (patch)
tree3ab7e214ba7055cc28f3fd2f2298554c3dcbf336 /common
parent3a16ab8c0ae9d0a91edde54fad64424d08a1ebfe (diff)
Fixing sonar issues
Added logging instead of skipping or printing stacktraces. Change-Id: I258a2a76c295f12b30e200c4519bc1bb0741f642 Issue-ID: SDC-2654 Signed-off-by: Dmitry Puzikov <d.puzikov2@partner.samsung.com>
Diffstat (limited to 'common')
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/ConfigurationUtils.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/ConfigurationUtils.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/ConfigurationUtils.java
index 991ec5fc8b..6adeb2db10 100644
--- a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/ConfigurationUtils.java
+++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/ConfigurationUtils.java
@@ -205,7 +205,7 @@ public class ConfigurationUtils {
try {
return Enum.valueOf(ConfigurationMode.class, modeName);
} catch (Exception exception) {
- //do nothing
+ LOGGER.debug("Configuration mode for merge strategy '{}' not found", modeName, exception);
}
}
}
@@ -231,7 +231,7 @@ public class ConfigurationUtils {
throw new ConfigurationException(CONFIGURATION_TYPE_NOT_SUPPORTED + configType);
}
} catch (ConfigurationException exception) {
- exception.printStackTrace();
+ LOGGER.error("Error reading configuration at {}.", url.toString(), exception);
}
return Optional.empty();
@@ -263,7 +263,7 @@ public class ConfigurationUtils {
try {
configurationMode = ConfigurationMode.valueOf(configMode);
} catch (Exception exception) {
- LOGGER.error("Could not find convert {} into configuration mode", configMode);
+ LOGGER.error("Could not find convert {} into configuration mode.", configMode, exception);
}
return Optional.ofNullable(configurationMode);
}
@@ -457,7 +457,7 @@ public class ConfigurationUtils {
return IOUtils.toString(new URL(path), Charset.defaultCharset());
}
} catch (Exception exception) {
- exception.printStackTrace();
+ LOGGER.error("Error while getting '{}' content", path, exception);
}
return null;
}
@@ -468,7 +468,7 @@ public class ConfigurationUtils {
return new String(Files.readAllBytes(path));
}
} catch (Exception exception) {
- exception.printStackTrace();
+ LOGGER.error("Error while getting '{}' content", path.toString(), exception);
}
return null;
}