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 48b370d264..7c73922573 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 @@ public class DistributedDynamicConfigStore @Override public CompletableFuture addNode(ResourceId complete, DataNode node) { - CompletableFuture 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 333cbb162e..0ef9aefaaa 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 class DocumentPath implements Comparable { 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());