[ https://issues.apache.org/jira/browse/JCR-3555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17099012#comment-17099012 ]
Julian Reschke commented on JCR-3555: ------------------------------------- trunk: (2.9.0) [r1463890|http://svn.apache.org/r1463890] [r1463860|http://svn.apache.org/r1463860] [r1463843|http://svn.apache.org/r1463843] > 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, JcrUtils.java.patch > > > I have stumbled upon the utility classes in the > org.apache.jackrabbit.commons.iterator package. They're quite useful in > principle, but not applied thoroughly. E.g. there are missing wrapper types > for at least these JCR Iterators: > - AccessControlPolicyIterator > - EventIterator > - EventListenerIterator > - NodeTypeIterator > - VersionIterator > Instead of adding more classes, it might be useful to create static methods > for the job. Using static methods from a single class (with static imports) > 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 suggestion. -- This message was sent by Atlassian Jira (v8.3.4#803005)