jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Kennedy <da...@us.ibm.com>
Subject Re: IllegalArgumentException with invalid UUID
Date Wed, 05 Jul 2006 13:51:41 GMT
"Jukka Zitting" <jukka.zitting@gmail.com> wrote on 07/02/2006 04:46:28 PM:

> 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.
> 
> The same logic could also be applied to Session.getItem(). Currently
> we throw a RepositoryException when encountering an invalid path.

Except if an empty path is passed in, in which case a 
MalformedPathException is currently thrown.  I'd argue that this should be 
a PathNotFoundException.

> 
> BR,
> 
> Jukka Zitting
> 
> -- 
> Yukatan - http://yukatan.fi/ - info@yukatan.fi
> Software craftsmanship, JCR consulting, and Java development

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message