jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: svn commit: r776654 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
Date Wed, 20 May 2009 12:31:00 GMT
Hi,

On Wed, May 20, 2009 at 2:22 PM, Julian Reschke <julian.reschke@gmx.de> wrote:
> Jukka, is it really a good idea to catch the RepositoryException here,
> mapping it to an unchecked exception?

Good point. The alternative I was thinking about doing is:

    @SuppressWarnings("unchecked")
    public static Iterable<Node> getNodes(Node node)
            throws RepositoryException {
        final Iterator<Node> iterator = node.getNodes();
        return new Iterable<Node>() {
            public Iterator<Node> iterator() {
                return iterator;
            }
        };
    }

The only problem with this one is that it only ever returns the same
iterator, but I guess we could simply document that in the javadoc.

BR,

Jukka Zitting

Mime
View raw message