This is an automated email from the ASF dual-hosted git repository.

thomasm pushed a commit to branch OAK-9780
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 8387f17d04b9dc869d3ae4eb72f1f2b1f28a6ffc
Author: Rishabh Kumar <d...@adobe.com>
AuthorDate: Tue May 17 20:47:53 2022 +0530

    OAK-9757 : move isNodeNameLong check to addNode api of commitbuilder
---
 .../jackrabbit/oak/plugins/document/DocumentNodeState.java     |  5 -----
 .../oak/plugins/document/MongoDocumentStoreTest.java           | 10 ++++------
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java
 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java
index a4fd5790a8..0af023ade3 100644
--- 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java
+++ 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java
@@ -414,11 +414,6 @@ public class DocumentNodeState extends 
AbstractDocumentNodeState implements Cach
      * @param revision the revision this node is created.
      */
     UpdateOp asOperation(@NotNull Revision revision) {
-
-        if (Utils.isNodeNameLong(path, 
store.getDocumentStore().getNodeNameLimit())) {
-            throw new DocumentStoreException("Node name is too long: " + path);
-        }
-
         String id = Utils.getIdFromPath(path);
         UpdateOp op = new UpdateOp(id, true);
         if (Utils.isIdFromLongPath(id)) {
diff --git 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreTest.java
 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreTest.java
index 4575cc9d79..c41b2f0b0d 100644
--- 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreTest.java
+++ 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreTest.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -249,12 +250,9 @@ public class MongoDocumentStoreTest {
         DocumentStore docStore = openDocumentStore();
         DocumentNodeStore store = 
builderProvider.newBuilder().setDocumentStore(docStore).setAsyncDelay(0).getNodeStore();
         Revision rev = Revision.newRevision(0);
-        List<UpdateOp> inserts = Lists.newArrayList();
-        for (int i = 0; i < 2; i++) {
-            DocumentNodeState n = new DocumentNodeState(store, 
Path.fromString(DocumentMK.LONG_PATH + i),
-                    new RevisionVector(rev));
-            inserts.add(n.asOperation(rev));
-        }
+        DocumentNodeState n = new DocumentNodeState(store, 
Path.fromString(DocumentMK.LONG_PATH), new RevisionVector(rev));
+        n.asOperation(rev);
+        fail("should not reach this point");
     }
 
     @Test

Reply via email to