"Jukka Zitting" <[EMAIL PROTECTED]> wrote on 07/02/2006 04:46:28 PM:
> Hi, > > On 7/2/06, Tobias Bocanegra <[EMAIL PROTECTED]> 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/ - [EMAIL PROTECTED] > Software craftsmanship, JCR consulting, and Java development