From d0f8678bfa7f06f06c9f1dd3cad862b1b99c3a03 Mon Sep 17 00:00:00 2001 From: Wojciech Sliwka Date: Tue, 22 May 2018 08:36:40 +0200 Subject: Fix sonar violations Fix major sonar violations in ConfigurationUtils,ConfigurationImpl, PropertyType Issue-ID: SDC-1353 Change-Id: Ic3959ba174f0a9fcd3976c9d12c6425dc4353e72 Signed-off-by: Wojciech Sliwka --- .../main/java/org/onap/config/impl/ConfigurationImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java') diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java index 43b1b96fc5..7faf3ee8cf 100644 --- a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java +++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java @@ -206,12 +206,13 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration { @Override public T get(String tenant, String namespace, String key, Class clazz, Hint... hints) { - String[] tenantNamespaceArrayy = null; - if (tenant == null && namespace != null - && (tenantNamespaceArrayy = namespace.split(Constants.TENANT_NAMESPACE_SAPERATOR)).length - > 1) { - tenant = tenantNamespaceArrayy[0]; - namespace = tenantNamespaceArrayy[1]; + String[] tenantNamespaceArrayy; + if (tenant == null && namespace != null) { + tenantNamespaceArrayy = namespace.split(Constants.TENANT_NAMESPACE_SAPERATOR); + if (tenantNamespaceArrayy.length > 1) { + tenant = tenantNamespaceArrayy[0]; + namespace = tenantNamespaceArrayy[1]; + } } tenant = ConfigurationRepository.lookup().isValidTenant(tenant) ? tenant.toUpperCase() -- cgit 1.2.3-korg