Hi,

On Wed, May 20, 2009 at 2:22 PM, Julian Reschke <[email protected]> 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

Reply via email to