You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by jo...@apache.org on 2024/10/15 16:07:02 UTC

(jackrabbit-oak) branch trunk updated: OAK-11200 use the improved API of the JackrabbitNode if possible (#1797)

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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new b8fd9d5fda OAK-11200 use the improved API of the JackrabbitNode if possible (#1797)
b8fd9d5fda is described below

commit b8fd9d5fdaf55db662e6227dd56f46ebc344b7af
Author: Jörg Hoh <jo...@users.noreply.github.com>
AuthorDate: Tue Oct 15 18:06:57 2024 +0200

    OAK-11200 use the improved API of the JackrabbitNode if possible (#1797)
---
 .../src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java     | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/oak-jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java b/oak-jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java
index e0e7a3dbca..5ad47e6b3d 100644
--- a/oak-jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java
+++ b/oak-jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java
@@ -268,6 +268,9 @@ public interface JackrabbitSession extends Session {
      */
     @Nullable 
     default Node getParentOrNull(@NotNull Item item) throws RepositoryException {
+        if (item instanceof JackrabbitNode) {
+            return ((JackrabbitNode) item).getParentOrNull();
+        }
         try {
             return item.getParent();
         } catch (ItemNotFoundException | AccessDeniedException e) {