jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: Getting a value by its data identifier
Date Mon, 18 Mar 2013 12:48:50 GMT
On 15.03.2013, at 09:01, Felix Meschberger <fmeschbe@adobe.com> wrote:

> I would prefer a SecurityException, but JCR has a notion of "no access looks the same
as non-existing",

Right, it should not be possible to find out if something exists if you don't have the permission!

> so an ItemNotFoundException would probably be thrown in this case (due to JCR throwing
an exception if something does not exist instead of just returning null).

I always found that a bad design - returning "null" for not found allows much more readable
code, since it is an expected case and not an unexpected failure case for which exceptions
are designed for. Not sure if a custom Jackrabbit API extension has to follow the same design...

Cheers,
Alex
Mime
View raw message