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 0BED9DEED for ; Tue, 24 Jul 2012 11:43:41 +0000 (UTC) Received: (qmail 3536 invoked by uid 500); 24 Jul 2012 11:43:40 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 3338 invoked by uid 500); 24 Jul 2012 11:43:40 -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 3233 invoked by uid 99); 24 Jul 2012 11:43:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2012 11:43:39 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anchela@adobe.com designates 64.18.1.25 as permitted sender) Received: from [64.18.1.25] (HELO exprod6og110.obsmtp.com) (64.18.1.25) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2012 11:43:31 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob110.postini.com ([64.18.5.12]) with SMTP ID DSNKUA6KTrbAIr3pc4TsRLGIf+CT4WwGNIQX@postini.com; Tue, 24 Jul 2012 04:43:10 PDT 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 q6OBekk0011260 for ; Tue, 24 Jul 2012 04:40:46 -0700 (PDT) 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 q6OBh9vm008719 for ; Tue, 24 Jul 2012 04:43:09 -0700 (PDT) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.264.0; Tue, 24 Jul 2012 04:43:09 -0700 Received: from angela.eur.adobe.com (10.132.1.18) by eurhub01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.264.0; Tue, 24 Jul 2012 12:43:06 +0100 Message-ID: <500E8A4A.5070403@adobe.com> Date: Tue, 24 Jul 2012 13:43:06 +0200 From: Angela Schreiber User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Subject: Re: Comment regarding TreeImpl#remove References: <500E8764.8040109@adobe.com> In-Reply-To: <500E8764.8040109@adobe.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org just found that Tree#getStatus() never returns REMOVED (see OAK-207). if that was the reason for that extra check i would suggest to refactor the code and check for status removed... that felt much clearer to me. gruesse angela On 7/24/12 1:30 PM, Angela Schreiber wrote: > hi michael > > the implementation of Tree#remove starts with the following line: > > if (!isRoot()&& parent.hasChild(name)) { > > and it seems to me that testing for the parent containing the > Tree that i am having at hand is superfluous. is that the > leftover of a refactoring or could it really occur that in this > situation parent.hasChild returns false? if the latter was > true, i think this line deserves a little comment explaining > to the poor reader what are the circumstances of that behaviour. > maybe we would even need some log output for that special case. > > what do you think? > angela