From a4f4215c435414360f281b625705595be9367ace Mon Sep 17 00:00:00 2001 From: leventecsanyi Date: Thu, 8 Dec 2022 14:49:29 +0100 Subject: Fixing SonarQube violations - Code smell fixes Signed-off-by: leventecsanyi Issue-ID: CPS-475 Change-Id: I4b47ece82aed7e4b31aaa28e601e419fb6f06718 --- .../main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cps-ncmp-service') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java index 1a54a824b2..bda0a728b4 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java @@ -47,6 +47,7 @@ public class CmHandleQueriesImpl implements CmHandleQueries { private static final String NCMP_DATASPACE_NAME = "NCMP-Admin"; private static final String NCMP_DMI_REGISTRY_ANCHOR = "ncmp-dmi-registry"; + private static final String DESCENDANT_PATH = "//"; private final CpsDataPersistenceService cpsDataPersistenceService; private static final Map NO_QUERY_TO_EXECUTE = null; @@ -72,7 +73,7 @@ public class CmHandleQueriesImpl implements CmHandleQueries { } Map cmHandleIdToNcmpServiceCmHandles = null; for (final Map.Entry publicPropertyQueryPair : propertyQueryPairs.entrySet()) { - final String cpsPath = "//" + propertyType.getYangContainerName() + "[@name=\"" + final String cpsPath = DESCENDANT_PATH + propertyType.getYangContainerName() + "[@name=\"" + publicPropertyQueryPair.getKey() + "\" and @value=\"" + publicPropertyQueryPair.getValue() + "\"]"; -- cgit 1.2.3-korg