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

Jukka Zitting commented on JCR-3465:
------------------------------------

The current implementation works just as documented: "all non-existent 
intermediate path elements will be created".

If a/b doesn't exist, then it is questionable whether "a/b/../../c/d/../../e/f" 
is a valid, resolvable path. From that perspective the getOrCreate contract 
clearly suggests that also a/b and c/d will get created if they don't already 
exist.

If we want to change the implementation, we should explicitly also change the 
contract to include something like: "The given path is syntactically normalized 
before it gets resolved."
                
> JcrUtils.getOrCreateByPath() creates a whole subtree instead of a single 
> branch
> -------------------------------------------------------------------------------
>
>                 Key: JCR-3465
>                 URL: https://issues.apache.org/jira/browse/JCR-3465
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Given a leaf node n,
> JcrUtils.getOrCreateByPath(n, "a/b/../../c/d/../../e/f", false, null, null, 
> true);
> will result in paths a/b, c/d and e/f being added to n where I'd only expect 
> the path e/f.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to