minor fix in DocumentPath, DCS
Change-Id: I13f332bc3897e7fc047744c36be4f208cf820d4f
diff --git a/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java b/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java
index 48b370d..7c73922 100644
--- a/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java
+++ b/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java
@@ -125,19 +125,18 @@
@Override
public CompletableFuture<Boolean>
addNode(ResourceId complete, DataNode node) {
- CompletableFuture<Boolean> eventFuture = CompletableFuture.completedFuture(true);
String spath = ResourceIdParser.parseResId(complete);
if (spath == null) {
throw new FailedException("Invalid RsourceId, cannot create Node");
}
- if (spath.compareTo(ResourceIdParser.ROOT) != 0) {
+ if (!spath.equals(ResourceIdParser.ROOT)) {
if (completeVersioned(keystore.get(DocumentPath.from(spath))) == null) {
throw new FailedException("Node or parent does not exist for " + spath);
}
}
spath = ResourceIdParser.appendNodeKey(spath, node.key());
parseNode(spath, node);
- return eventFuture;
+ return CompletableFuture.completedFuture(true);
}
private void parseNode(String path, DataNode node) {
diff --git a/core/api/src/main/java/org/onosproject/store/service/DocumentPath.java b/core/api/src/main/java/org/onosproject/store/service/DocumentPath.java
index 333cbb1..0ef9aef 100644
--- a/core/api/src/main/java/org/onosproject/store/service/DocumentPath.java
+++ b/core/api/src/main/java/org/onosproject/store/service/DocumentPath.java
@@ -74,8 +74,8 @@
public DocumentPath(String nodeName, DocumentPath parentPath) {
checkNotNull(nodeName, "Node name cannot be null");
if (nodeName.contains(pathSeparator)) {
- throw new IllegalDocumentNameException(
- "Periods are not allowed in names.");
+ throw new IllegalDocumentNameException("'" + pathSeparator + "'" +
+ " are not allowed in names.");
}
if (parentPath != null) {
pathElements.addAll(parentPath.pathElements());