stefan-egli commented on code in PR #560:
URL: https://github.com/apache/jackrabbit-oak/pull/560#discussion_r874743248
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java:
##########
@@ -414,6 +414,11 @@ public String toString() {
* @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);
+ }
+
Review Comment:
What I was wondering, what about moving this check from the somewhat
implicit `asOperaiton` location to the a bit more explicit
`CommitBuilder.addNode(Path)`? It should have the same effect, as `addPath`
does eventually call `asOperation` .. but having it in `addNode(Path)` would
seem a bit more logical for people reading the code.
But the question would still be somewhat open: is this the only place where
long node names can be added .. maybe @mreutegg / @reschke can comment too. The
only suspicious place I found was `SplitOperations.createIntermediateDocs` -
but that only adds a few characters to the id and therefore is probably fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]