diff options
author | 2021-08-16 13:31:33 +0100 | |
---|---|---|
committer | 2021-08-16 13:46:16 +0100 | |
commit | 5e939b902b44845bf68d4e21d11493fcac08c262 (patch) | |
tree | 53e3c8b83b50f0640db74dc5d5aaa0682094275c /cps-ri/src/main/java | |
parent | d80bc376f1412fa892601a6e763c4702590c2e88 (diff) |
CPS-566: Can't access grandparent node through ancestor axis
Reason for this change is listed in the jira.
Issue-ID: CPS-566
Signed-off-by: shivasubedi <shiva.subedi@est.tech>
Change-Id: I25315791cd0b8f5c1124578ab486afbdb3ba4c47
Diffstat (limited to 'cps-ri/src/main/java')
-rw-r--r-- | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java | 6 |
1 files changed, 3 insertions, 3 deletions
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 fdbafd4be..20b51c819 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 @@ -81,7 +81,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService } private static final Gson GSON = new GsonBuilder().create(); - private static final String REG_EX_FOR_OPTIONAL_LIST_INDEX = "(\\[@\\S+?]){0,1})"; + private static final String REG_EX_FOR_OPTIONAL_LIST_INDEX = "(\\[@[\\s\\S]+?]){0,1})"; @Override public void addChildDataNode(final String dataspaceName, final String anchorName, final String parentXpath, @@ -208,8 +208,8 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService final CpsPathQuery cpsPathQuery) { final Set<String> ancestorXpath = new HashSet<>(); final var pattern = - Pattern.compile("(\\S*\\/" + Pattern.quote(cpsPathQuery.getAncestorSchemaNodeIdentifier()) - + REG_EX_FOR_OPTIONAL_LIST_INDEX + "\\/\\S*"); + Pattern.compile("([\\s\\S]*\\/" + Pattern.quote(cpsPathQuery.getAncestorSchemaNodeIdentifier()) + + REG_EX_FOR_OPTIONAL_LIST_INDEX + "\\/[\\s\\S]*"); for (final FragmentEntity fragmentEntity : fragmentEntities) { final var matcher = pattern.matcher(fragmentEntity.getXpath()); if (matcher.matches()) { |