Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-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 99BD0FED9 for ; Wed, 3 Apr 2013 08:31:19 +0000 (UTC) Received: (qmail 61911 invoked by uid 500); 3 Apr 2013 08:31:19 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 61810 invoked by uid 500); 3 Apr 2013 08:31:19 -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 61474 invoked by uid 99); 3 Apr 2013 08:31:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 08:31:16 +0000 Date: Wed, 3 Apr 2013 08:31:16 +0000 (UTC) From: =?utf-8?Q?Michael_D=C3=BCrig_=28JIRA=29?= To: dev@jackrabbit.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (JCR-3555) Add a static utility to transform JCR Iterators into Iterables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-3555?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D136207= 27#comment-13620727 ]=20 Michael D=C3=BCrig commented on JCR-3555: ------------------------------------ +1 for IllegalStateException instead of RuntimeException as in revision 146= 3860 +1 for a marker interface (i.e. OneShotIterable) such that clients can find= out about the specific behaviour not just after the fact.=20 =20 > Add a static utility to transform JCR Iterators into Iterables > -------------------------------------------------------------- > > Key: JCR-3555 > URL: https://issues.apache.org/jira/browse/JCR-3555 > Project: Jackrabbit Content Repository > Issue Type: Improvement > Components: jackrabbit-jcr-commons > Affects Versions: 2.6 > Reporter: Lukas Eder > Priority: Minor > Attachments: Iterators.java.patch > > > I have stumbled upon the utility classes in the org.apache.jackrabbit.com= mons.iterator package. They're quite useful in principle, but not applied t= horoughly. E.g. there are missing wrapper types for at least these JCR Iter= ators: > - AccessControlPolicyIterator > - EventIterator > - EventListenerIterator > - NodeTypeIterator > - VersionIterator > Instead of adding more classes, it might be useful to create static metho= ds for the job. Using static methods from a single class (with static impor= ts) is a bit more convenient than looking up and creating the wrapper types= using "new WrapperType(...)" > An example: > org.apache.jackrabbit.commons.iterator.Iterators.iterable > // And then: > for (Node n : iterable(parent.getNodes())) { > // Do stuff with n > } > Please find attached a .patch file containing an implementation suggestio= n. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira