[ 
https://issues.apache.org/jira/browse/JCR-3992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15370747#comment-15370747
 ] 

Carsten Ziegeler edited comment on JCR-3992 at 7/11/16 2:00 PM:
----------------------------------------------------------------

Sorry for the mess, the following patch should fix the problem:
{noformat}
Index: src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
===================================================================
--- src/main/java/org/apache/jackrabbit/commons/JcrUtils.java   (Revision 
1752156)
+++ src/main/java/org/apache/jackrabbit/commons/JcrUtils.java   (Arbeitskopie)
@@ -1561,7 +1561,7 @@
 
         if (existingPath != null) {
             baseNode = baseNode.getSession().getNode(existingPath);
-            path = path.substring(existingPath.length() + 1);
+            path = fullPath.substring(existingPath.length() + 1);
         }
 
         Node node = baseNode;


{noformat}


was (Author: cziegeler):
Sorry for the mess, the following patch should fix the problem:

Index: src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
===================================================================
--- src/main/java/org/apache/jackrabbit/commons/JcrUtils.java   (Revision 
1752156)
+++ src/main/java/org/apache/jackrabbit/commons/JcrUtils.java   (Arbeitskopie)
@@ -1561,7 +1561,7 @@
 
         if (existingPath != null) {
             baseNode = baseNode.getSession().getNode(existingPath);
-            path = path.substring(existingPath.length() + 1);
+            path = fullPath.substring(existingPath.length() + 1);
         }
 
         Node node = baseNode;

> JcrUtils.getOrCreateByPath broken by JCR-3987
> ---------------------------------------------
>
>                 Key: JCR-3992
>                 URL: https://issues.apache.org/jira/browse/JCR-3992
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.13.0, 2.10.4, 2.12.3
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>         Attachments: JCR-3992.diff
>
>
> The code introduced with OAK-3987 fails for an input of
> {noformat}
>    /rep:security/rep:authorizables/rep:groups/a/b/c
> {noformat}
> as, after discovering that
> {noformat}
>    /rep:security/rep:authorizables/rep:groups
> {noformat}
> exists, it computes a remaining path of
> {noformat}
>    /b/c
> {noformat}
> instead of
> {noformat}
>    a/b/c
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to