Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 56EE2E8F3 for ; Wed, 21 Nov 2012 10:15:14 +0000 (UTC) Received: (qmail 32580 invoked by uid 500); 21 Nov 2012 10:15:13 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 32444 invoked by uid 500); 21 Nov 2012 10:15:11 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 32415 invoked by uid 99); 21 Nov 2012 10:15:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Nov 2012 10:15:10 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mueller@adobe.com designates 64.18.1.78 as permitted sender) Received: from [64.18.1.78] (HELO exprod6og127.obsmtp.com) (64.18.1.78) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Nov 2012 10:15:00 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob127.postini.com ([64.18.5.12]) with SMTP ID DSNKUKypjvrPMEGm+VVa196gz2O7B+fccHb1@postini.com; Wed, 21 Nov 2012 02:14:39 PST Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id qALABm1v028220 for ; Wed, 21 Nov 2012 02:11:48 -0800 (PST) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id qALABMO9022413 for ; Wed, 21 Nov 2012 02:14:37 -0800 (PST) Received: from eurcas01.eur.adobe.com (10.128.4.27) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.279.1; Wed, 21 Nov 2012 02:13:43 -0800 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurcas01.eur.adobe.com ([10.128.4.27]) with mapi; Wed, 21 Nov 2012 10:13:41 +0000 From: Thomas Mueller To: "oak-dev@jackrabbit.apache.org" Date: Wed, 21 Nov 2012 10:13:38 +0000 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 Thread-Topic: 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 Thread-Index: Ac3H0OFdAMWeWNhjRUiGqbfWvihUDA== Message-ID: In-Reply-To: <50AC90E2.1010704@adobe.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.4.120824 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi, For the query engine, I will need a "validate and normalize path" function that verifies a path is syntactically correct, and simplifies it if possible, for example: /a/./b =3D> /a/b /a/../b =3D> /b a/.. =3D> . ./a =3D> a . =3D>=20 a/. =3D> a /.. =3D> invalid .. =3D> .. /./. =3D> / This will not solve the case where a relative path starts with ".." (possibly multiple levels). I'm wondering if that would be the only remaining case (a normalize path would never contain "current path", plus "parent" would always be at the beginning). Regards, Thomas On 11/21/12 9:29 AM, "Angela Schreiber" wrote: >hi michael > >> + TreeLocation loc =3D getLocation(); >> + for (String element : PathUtils.elements(relPath)) { >> + if (PathUtils.denotesParent(element)) { >> + loc =3D loc.getParent(); >> + } else if (!PathUtils.denotesCurrent(element)) { >> + loc =3D 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... 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. > >this really looks troublesome and hacky to me. > >kind regards >angela