joerghoh commented on code in PR #1781:
URL: https://github.com/apache/jackrabbit-oak/pull/1781#discussion_r1800691454
##########
oak-jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitNode.java:
##########
@@ -87,4 +89,18 @@ void setMixins(String[] mixinNames)
return null;
}
}
+
+ /**
+ * Same as {@link #getParent()}, but instead of throwing an
ItemNotFoundException or AccessDeniedException
+ * just return {@code null}.
+ * @return the parent node, or {@code null} if there is no parent or the
parent node is not accessible.
+ * @throws RepositoryException if an error occurs.
+ */
+ default @Nullable Node getParentOrNull() throws RepositoryException {
+ try {
+ return getParent();
+ } catch (ItemNotFoundException | AccessDeniedException e) {
+ return null;
Review Comment:
This is just the default implementation, so I would not do that here.
--
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]