aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ri
diff options
context:
space:
mode:
authorNiamh Core <niamh.core@est.tech>2021-08-17 08:39:48 +0000
committerGerrit Code Review <gerrit@onap.org>2021-08-17 08:39:48 +0000
commitdca30738006c456afd807512a2f80c207b53d3c6 (patch)
tree5b6cd8a893d837b7f9b153b7554794515d7f15fe /cps-ri
parentf351ced1db57e63663b84acdab9410aa517018c8 (diff)
parent5e939b902b44845bf68d4e21d11493fcac08c262 (diff)
Merge "CPS-566: Can't access grandparent node through ancestor axis"
Diffstat (limited to 'cps-ri')
-rw-r--r--cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java6
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 adb29b6292..c638b9113e 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,
@@ -222,8 +222,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()) {