hi jukka,
On 7/2/06, Jukka Zitting <[EMAIL PROTECTED]> wrote:
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.
i think ItemNotFoundException is misleading and inconsistent,
RepositoryException
would IMO be more appropriate. api methods in jackrabbit that take path
arguments throw RepositoryException rather than PathNotFoundException
if the path format is incorrect.
cheers
stefan
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/ - [EMAIL PROTECTED]
Software craftsmanship, JCR consulting, and Java development