From 36ff5bfad0c762b65013a9ff1074b37f8306aff9 Mon Sep 17 00:00:00 2001 From: ojasdubey Date: Wed, 27 Dec 2017 20:30:32 +0530 Subject: Fix Sonar violations - ConfigurationDataSource 1. Fixed major sonar violations configuration management core - ConfigurationDataSource Change-Id: Iee96111b3051a67d25f99a0ba49e99f4d9290345 Issue-ID: SDC-343 Signed-off-by: ojasdubey --- .../java/org/openecomp/config/impl/ConfigurationDataSource.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'common/openecomp-common-configuration-management/openecomp-configuration-management-core') diff --git a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java index 0cfc96bc7f..a60403e4dc 100644 --- a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java +++ b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java @@ -22,11 +22,16 @@ public final class ConfigurationDataSource { private static Set validCallers = Collections.unmodifiableSet(new HashSet<>( Arrays.asList(ConfigurationUtils.class.getName(), CliConfigurationImpl.class.getName()))); + private ConfigurationDataSource() { + //Hide constructor to prevent instantiation using the default implicit constructor + } + static { try { configDBDatasource = initDataSource(); } catch (Exception exception) { - System.err.println("Datasource initialization error. Configuration management will be using in-memory persistence."); + System.err.println("Datasource initialization error. Configuration management will be using" + + "in-memory persistence."); } } @@ -83,7 +88,6 @@ public final class ConfigurationDataSource { Driver driver = Driver.class.cast(Class.forName(driverClassName).newInstance()); return driver.acceptsURL(url); } catch (Exception exception) { - exception.printStackTrace(); return false; } } -- cgit 1.2.3-korg