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

Reply via email to