summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main/java/org/onap
diff options
context:
space:
mode:
authorputhuparambil.aditya <aditya.puthuparambil@bell.ca>2022-03-01 11:51:20 +0000
committerputhuparambil.aditya <aditya.puthuparambil@bell.ca>2022-03-03 14:10:15 +0000
commitbb030cb7803d3d08f86de5eb1c6be5ad32f5fbf6 (patch)
treef92d4946fd63f4ddf6d5954894abe56a2bf24e01 /cps-ri/src/main/java/org/onap
parent304b9f319cddad71a77f6bbffb8c18f63b7f5ee2 (diff)
Bug fix for delete data node not working for root node
Fixing event for deletion of container node Fixing event for deletion of root node when '' is passed as xpath Issue-ID: CPS-895 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I0676aec29e7b7e12bef2300219207ddc22414daa
Diffstat (limited to 'cps-ri/src/main/java/org/onap')
-rw-r--r--cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java4
1 files changed, 2 insertions, 2 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 f22d83b981..78862d7233 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
@@ -337,7 +337,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
deleteDataNodes(dataspaceName, anchorName);
targetDeleted = true;
} else {
- if (isContainerNodeXpath(targetXpath)) {
+ if (isRootContainerNodeXpath(targetXpath)) {
parentNodeXpath = targetXpath;
} else {
parentNodeXpath = targetXpath.substring(0, targetXpath.lastIndexOf('/'));
@@ -423,7 +423,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
return !existingListElementsByXpath.containsKey(replacementDataNode.getXpath());
}
- private static boolean isContainerNodeXpath(final String xpath) {
+ private static boolean isRootContainerNodeXpath(final String xpath) {
return 0 == xpath.lastIndexOf('/');
}