summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main
diff options
context:
space:
mode:
authorToine Siebelink <toine.siebelink@est.tech>2023-05-08 09:26:46 +0000
committerGerrit Code Review <gerrit@onap.org>2023-05-08 09:26:46 +0000
commit1be9234c5234883be1e8d66baf7a780fa6be8ccf (patch)
treeacb4a1c9aa973f6f53cafca9d73a5d84ceeb2edd /cps-ri/src/main
parentc1ff3a18970e7d53d20fae2617c1fef3791a6377 (diff)
parentec061d5caba23c76f0cdc183c1f5a37e0c11b6c7 (diff)
Merge "[CPS] RI: Code Refactoring # Replace '[\s\S]' to '.' as it is same as '.' while grouping in regex # Updated the groovy files to add 'assert' and to replace deprecated method # Removed deprecated 'storeDataNode' method."
Diffstat (limited to 'cps-ri/src/main')
-rw-r--r--cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java11
1 files changed, 3 insertions, 8 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 3a1588a59a..cca5d9c849 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
@@ -82,7 +82,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
private final JsonObjectMapper jsonObjectMapper;
private final SessionManager sessionManager;
- private static final String REG_EX_FOR_OPTIONAL_LIST_INDEX = "(\\[@[\\s\\S]+?])?)";
+ private static final String REG_EX_FOR_OPTIONAL_LIST_INDEX = "(\\[@.+?])?)";
private static final String QUERY_ACROSS_ANCHORS = null;
private static final AnchorEntity ALL_ANCHORS = null;
@@ -171,11 +171,6 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
}
@Override
- public void storeDataNode(final String dataspaceName, final String anchorName, final DataNode dataNode) {
- storeDataNodes(dataspaceName, anchorName, Collections.singletonList(dataNode));
- }
-
- @Override
public void storeDataNodes(final String dataspaceName, final String anchorName,
final Collection<DataNode> dataNodes) {
final AnchorEntity anchorEntity = getAnchorEntity(dataspaceName, anchorName);
@@ -434,8 +429,8 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
final CpsPathQuery cpsPathQuery) {
final Set<String> ancestorXpath = new HashSet<>();
final Pattern pattern =
- Pattern.compile("([\\s\\S]*/" + Pattern.quote(cpsPathQuery.getAncestorSchemaNodeIdentifier())
- + REG_EX_FOR_OPTIONAL_LIST_INDEX + "/[\\s\\S]*");
+ Pattern.compile("(.*/" + Pattern.quote(cpsPathQuery.getAncestorSchemaNodeIdentifier())
+ + REG_EX_FOR_OPTIONAL_LIST_INDEX + "/.*");
for (final FragmentEntity fragmentEntity : fragmentEntities) {
final Matcher matcher = pattern.matcher(fragmentEntity.getXpath());
if (matcher.matches()) {