jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: svn commit: r1411900 - in /jackrabbit/oak/trunk/oak-jcr: pom.xml src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Wed, 21 Nov 2012 09:50:34 GMT


On 21.11.12 9:29, Angela Schreiber wrote:
> hi michael
>
>> +        TreeLocation loc = getLocation();
>> +        for (String element : PathUtils.elements(relPath)) {
>> +            if (PathUtils.denotesParent(element)) {
>> +                loc = loc.getParent();
>> +            } else if (!PathUtils.denotesCurrent(element)) {
>> +                loc = loc.getChild(element);
>> +            }  // else . ->  skip to next element
>> +        }
>> +        return loc;
>
> this is exactly the reason why i was asking for having that
> included in TreeLocation and Tree...

Which is the wrong place to do that. See OAK-426. TreeLocation supports 
relative paths without interpreting special names. If we start 
interpreting special names in Tree, we tear functionality from plugins 
into core which is definitely wrong.

we keep adding the exact
> same code everywhere and i am quite sure that you didn't
> cover all usages of relativePath defined by JCR API by this
> fix.

File an issue if it doesn't.

>
> this really looks troublesome and hacky to me.

One reason I didn't use LocationUtil instead is since you decided to use 
different methods for handling paths there instead of using PathUtils we 
use everywhere else. This breaks encapsulation and uniformity.

Michael

>
> kind regards
> angela

Mime
View raw message