jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: IllegalArgumentException with invalid UUID
Date Mon, 03 Jul 2006 08:05:35 GMT
hi jukka,

On 7/2/06, Jukka Zitting <jukka.zitting@gmail.com> wrote:
> Hi,
> On 7/2/06, Tobias Bocanegra <tobias.bocanegra@day.com> wrote:
> > why? it's an illegal argument, since the uuid format is not valid.
> > i disagree to throw another exception. i suggest to add the
> > IllegalArgumentException to the spec/javadoc.
> The spec never references the UUID specification or defines the UUID
> format being used. There's even an example with "1111 2222 3333 4444"
> as an UUID, so to me the UUID format in JCR is not really clear enough
> to warrant an IllegalArgumentException.
> And even if it were clearly defined, I'd still vote for an
> ItemNotFoundException because the application calling
> Session.getNodeByUUID() is primarily looking for the node and doesn't
> care whether the UUID format is correct. Throwing an unchecked
> exception will definitely surprise a number of applications. Even a
> RepositoryException would be better than IllegalArgumentException.

i think ItemNotFoundException is misleading and inconsistent,
would IMO be more appropriate. api methods in jackrabbit that take path
arguments throw RepositoryException rather than PathNotFoundException
if the path format is incorrect.


> The same logic could also be applied to Session.getItem(). Currently
> we throw a RepositoryException when encountering an invalid path.
> BR,
> Jukka Zitting
> --
> Yukatan - http://yukatan.fi/ - info@yukatan.fi
> Software craftsmanship, JCR consulting, and Java development

View raw message