jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller" <thomas.tom.muel...@gmail.com>
Subject Re: Database connections & queries
Date Mon, 27 Aug 2007 10:06:16 GMT
Hi,

> 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.

Thomas

Mime
View raw message