Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64E78988E for ; Tue, 7 Feb 2012 18:25:25 +0000 (UTC) Received: (qmail 15975 invoked by uid 500); 7 Feb 2012 18:25:24 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 15728 invoked by uid 500); 7 Feb 2012 18:25:23 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 15719 invoked by uid 99); 7 Feb 2012 18:25:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 18:25:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 18:25:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CAE741A7A30 for ; Tue, 7 Feb 2012 18:24:59 +0000 (UTC) Date: Tue, 7 Feb 2012 18:24:59 +0000 (UTC) From: "Uwe Schindler (Updated) (JIRA)" To: dev@lucene.apache.org Message-ID: <258172036.9418.1328639099833.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <406129087.9409.1328638979405.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (LUCENE-3757) Change AtomicReaderContext.leaves() to return itsself as only leave to simplify code and remove an otherwise unneeded ReaderUtil method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Uwe Schindler updated LUCENE-3757: ---------------------------------- Attachment: LUCENE-3757.patch Simple patch. The only small issue is, that the "leaf" of this context also returns itsself, which should not be an issue, as leaves() is never called recursively (in contrast to children()). > Change AtomicReaderContext.leaves() to return itsself as only leave to simplify code and remove an otherwise unneeded ReaderUtil method > --------------------------------------------------------------------------------------------------------------------------------------- > > Key: LUCENE-3757 > URL: https://issues.apache.org/jira/browse/LUCENE-3757 > Project: Lucene - Java > Issue Type: Improvement > Reporter: Uwe Schindler > Assignee: Uwe Schindler > Attachments: LUCENE-3757.patch > > > The documentation of IndexReaderContext.leaves() states that it returns (for convenience) all leave nodes, if the context is top-level (directly got from IndexReader), otherwise returns null. This is not correct for AtomicReaderContext, where it returns null always. > To make it consistent, the convenience method should simply return itsself as only leave for atomic contexts. This makes the utility method ReaderUtil.leaves() obsolete and simplifies code. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org