From c27465347d10b573e7a211c0b11b7c8a6fd792c0 Mon Sep 17 00:00:00 2001 From: lukegleeson Date: Thu, 2 Sep 2021 15:11:34 +0100 Subject: Fix Sonar Qube Violations Issue-ID: CPS-475 Signed-off-by: lukegleeson Change-Id: Iffd7b24cf42db73a8b93c4d1f2860e41a82e565d --- .../org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cps-ncmp-service/src/main/java/org') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index dfe5603431..c840c0a7d4 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -225,11 +225,10 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService private DataNode fetchDataNodeFromDmiRegistryForCmHandle(final String cmHandle) { final String xpathForDmiRegistryToFetchCmHandle = "/dmi-registry/cm-handles[@id='" + cmHandle + "']"; - final var dataNode = cpsDataService.getDataNode(NCMP_DATASPACE_NAME, + return cpsDataService.getDataNode(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, xpathForDmiRegistryToFetchCmHandle, FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS); - return dataNode; } private String prepareOperationBody(final GenericRequestBody requestBodyObject) { @@ -243,7 +242,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } private Map getCmHandlePropertiesAsMap(final Collection cmHandlePropertiesList) { - if (cmHandlePropertiesList == null || cmHandlePropertiesList.size() == 0) { + if (cmHandlePropertiesList == null || cmHandlePropertiesList.isEmpty()) { return null; } final Map cmHandlePropertiesMap = new LinkedHashMap<>(); @@ -329,7 +328,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService persistenceCmHandle.setDmiServiceName(dmiPluginService); persistenceCmHandle.setId(cmHandle.getCmHandleID()); if (cmHandle.getCmHandleProperties() == null) { - persistenceCmHandle.setAdditionalProperties(Collections.EMPTY_MAP); + persistenceCmHandle.setAdditionalProperties(Collections.emptyMap()); } else { persistenceCmHandle.setAdditionalProperties(cmHandle.getCmHandleProperties()); } -- cgit 1.2.3-korg