Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 15380 invoked from network); 20 May 2009 09:25:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 May 2009 09:25:40 -0000 Received: (qmail 4477 invoked by uid 500); 20 May 2009 09:25:52 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 4409 invoked by uid 500); 20 May 2009 09:25:52 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 4401 invoked by uid 99); 20 May 2009 09:25:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2009 09:25:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of julian.reschke@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 20 May 2009 09:25:43 +0000 Received: (qmail invoked by alias); 20 May 2009 09:25:21 -0000 Received: from p508FC68B.dip.t-dialin.net (EHLO [192.168.178.22]) [80.143.198.139] by mail.gmx.net (mp055) with SMTP; 20 May 2009 11:25:21 +0200 X-Authenticated: #1915285 X-Provags-ID: V01U2FsdGVkX18viDp4FHsv7J+BVhWm9w9J0zORj5+l0nQgmjbALN NpUN2cE1gUyS6U Message-ID: <4A13CC7E.80203@gmx.de> Date: Wed, 20 May 2009 11:25:18 +0200 From: Julian Reschke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.4) Gecko/20060516 Thunderbird/1.5.0.4 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: dev@jackrabbit.apache.org Subject: Re: [jira] Reopened: (JCR-2120) Make RangeIterator extend java.lang.Iterable References: <1586384989.1242808425561.JavaMail.jira@brutus> <4A13C3D1.1060707@gmail.com> <91f3b2650905200206q44f93b4fyaf402b4dddc1c81f@mail.gmail.com> In-Reply-To: <91f3b2650905200206q44f93b4fyaf402b4dddc1c81f@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.66 X-Virus-Checked: Checked by ClamAV on apache.org Thomas M�ller wrote: > Hi, > > I believe this is the right solution for now. With static import: > > for (Node child : childNodes(node)) { ... } > > This is far more readable than: > > for (NodeIterator it = node.getNodes(); it.hasNext();) { > Node child = it.nextNode(); > ... > } I disagree here; it depends on how familiar the reader is with static imports in general, and JCRUtils in particular. It's shorter, but requires additional knowledge of both language and libraries in use. > The best API would be probably: > for (Node child : node.getNodeList()) > ... The best API would be: for (Node child : node.getNodes()) ... and I think we get there once java.util.Iterator implements Iterable, which I think is planned for future Java release. BR, Julian