SLING-10463 - use nodeExists()
diff --git a/src/main/java/org/apache/sling/jcr/repoinit/impl/AclVisitor.java b/src/main/java/org/apache/sling/jcr/repoinit/impl/AclVisitor.java
index d20bf61..8377e8b 100644
--- a/src/main/java/org/apache/sling/jcr/repoinit/impl/AclVisitor.java
+++ b/src/main/java/org/apache/sling/jcr/repoinit/impl/AclVisitor.java
@@ -144,8 +144,8 @@
try {
if (session.propertyExists(fullPath)) {
throw new RuntimeException("Error creating Node at " + fullPath + ": a property exists with the same path");
- } else if (session.itemExists(fullPath)) {
- log.info("Path already exists, nothing to do (and not checking its primary type for now): {}", fullPath);
+ } else if (session.nodeExists(fullPath)) {
+ log.info("Node already exists, nothing to do (and not checking its primary type for now): {}", fullPath);
} else {
final Node parent = parentPath.equals("") ? session.getRootNode() : session.getNode(parentPath);
log.info("Creating node {} with primary type {}", fullPath, psd.getPrimaryType());
diff --git a/src/test/java/org/apache/sling/jcr/repoinit/CreatePathsTest.java b/src/test/java/org/apache/sling/jcr/repoinit/CreatePathsTest.java
index fe83738..e72115f 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/CreatePathsTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/CreatePathsTest.java
@@ -19,7 +19,6 @@
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
-import java.util.UUID;
import javax.jcr.Node;
import javax.jcr.RepositoryException;