From 10f834104ead71661cff6823a79b9346169b79e1 Mon Sep 17 00:00:00 2001 From: niamhcore Date: Tue, 4 May 2021 09:52:19 +0100 Subject: Fix ancestor cps path to recognize ancestor list value Issue-ID: CPS-305 Signed-off-by: niamhcore Change-Id: I28f7f0c120a39190068a3192dccf0a1a6fbfeaf2 --- .../java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cps-ri/src/main/java/org') diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java index ab135fd3ae..343a0886b3 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java @@ -175,8 +175,8 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService final CpsPathQuery cpsPathQuery) { final Set ancestorXpath = new HashSet<>(); final var pattern = - Pattern.compile("(\\S*\\/" + cpsPathQuery.getAncestorSchemaNodeIdentifier() + REG_EX_FOR_OPTIONAL_LIST_INDEX - + "\\/\\S*"); + Pattern.compile("(\\S*\\/" + Pattern.quote(cpsPathQuery.getAncestorSchemaNodeIdentifier()) + + REG_EX_FOR_OPTIONAL_LIST_INDEX + "\\/\\S*"); for (final FragmentEntity fragmentEntity : fragmentEntities) { final var matcher = pattern.matcher(fragmentEntity.getXpath()); if (matcher.matches()) { -- cgit 1.2.3-korg