From oak-dev-return-3364-apmail-jackrabbit-oak-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Jan 31 13:35:40 2013 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 69050E09A for ; Thu, 31 Jan 2013 13:35:40 +0000 (UTC) Received: (qmail 1767 invoked by uid 500); 31 Jan 2013 13:35:40 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 1671 invoked by uid 500); 31 Jan 2013 13:35:37 -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 1647 invoked by uid 99); 31 Jan 2013 13:35:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jan 2013 13:35:36 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.18.1.181] (HELO exprod6og101.obsmtp.com) (64.18.1.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jan 2013 13:35:28 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob101.postini.com ([64.18.5.12]) with SMTP ID DSNKUQpzC42/pVpoITlexOwE8gqx7+fNtwMp@postini.com; Thu, 31 Jan 2013 05:35:08 PST Received: from inner-relay-4.eur.adobe.com (inner-relay-4b [10.128.4.237]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r0VDZ6C9024899 for ; Thu, 31 Jan 2013 05:35:06 -0800 (PST) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id r0VDXSXQ028134 for ; Thu, 31 Jan 2013 05:35:06 -0800 (PST) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas03.corp.adobe.com (10.8.189.121) with Microsoft SMTP Server (TLS) id 8.3.297.1; Thu, 31 Jan 2013 05:33:43 -0800 Received: from susi.local (10.136.129.47) by eurhub01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.297.1; Thu, 31 Jan 2013 13:33:41 +0000 Message-ID: <510A72B6.8030306@apache.org> Date: Thu, 31 Jan 2013 13:33:42 +0000 From: =?UTF-8?B?TWljaGFlbCBEw7xyaWc=?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Subject: Re: Regarding NullLocation#getParent (was Re: svn commit: r1440930) References: <20130131123134.2BDEE23889ED@eris.apache.org> <510A6CD2.90103@adobe.com> In-Reply-To: <510A6CD2.90103@adobe.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 31.1.13 13:08, Angela Schreiber wrote: > hi michael > > while looking at the TreeLocation implementation was wondering about > NullLocation#getParent() as IMO it violates the API contract because > it always returns the NULL-location. is there a particular reason > for this? and wouldn't it be possible to return the original > parent location through which this NULL location had originally > be accessed? to me that would feel much more natural that having > a location that all in a sudden is isolated from the hierarchy. > > what do you think? The intention of NullLocation was to indicate that the path of navigation through which the NullLocation was obtained is invalid. But it is true that this somewhat contradicts the contract of getParent(). If we change this the way you propose, we need to keep track of a potential hierarchy of NullLocations. I.e. in the case someone calls getChild() on a NullLocation. If we do that, we should also change the contract of getPath() to not return null for NullLocations but rather the path of that location. Otherwise it is a bit funny that you can navigate from a location with a null path up the hierarchy to a location with a non null path. Michael > > regards > angela > >> + /** >> + * @return {@code NULL} >> + */ >> + @Override >> + public TreeLocation getParent() { >> + return NULL; >> + } >