Hi, On 8/27/07, Thomas Mueller <[EMAIL PROTECTED]> wrote: > > We could change the behaviour of the iterator to throw a > > NoSuchElementException. > > That's an exception already declared on nextNode(). > > What about a new JackrabbitRuntimeException? NoSuchElementException is > a RuntimeException as well. NoSuchElementException means "the > iteration has no more elements", and is thrown if next() was called > too many times. I prefer fewer exception classes, but in this case > reusing NoSuchElementException doesn't feel right (to me), because the > same exception is thrown for a common user error (not calling or > ignoring hasNext()), and internal problems like dropped connections.
+1 Using NoSuchElementException would make it difficult for a client to determine the real cause of the failure. This is actually something we may want to take up in JSR 283, perhaps even going as far as adding a RepositoryException to nextNode()... BR, Jukka Zitting