jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: svn commit: r1434364 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: NodeImpl.java SessionDelegate.java SessionImpl.java WorkspaceImpl.java query/QueryImpl.java version/VersionManagerImpl.java
Date Thu, 17 Jan 2013 14:17:16 GMT


On 17.1.13 5:33, Jukka Zitting wrote:
> Hi,
>
> On Wed, Jan 16, 2013 at 11:04 PM, Jukka Zitting <jukka.zitting@gmail.com> wrote:
>> If yes, please revert, as these methods were intentionally added to
>> satisfy the need for different exceptions in different cases.
>
> Hmm, on second thought that's a bit harsh and not too constructive,
> sorry. Let me rephrase:

Hehe this is contagious isn't it ;-)

>
> If yes, please make sure that all the name- and path-related
> exceptions that get thrown are still appropriate in their contexts.

Right, I might have been too eager in some cases. Will reopen the issue 
and review.

>
> Even though PathNotFoundException ISA RepositoryException, it has
> fairly specific semantics and is thus not appropriate for all cases

Hat tip to Liskov ;-)

Michael

> where names and paths are used. For example, is the following code
> correct:
>
>      try {
>          if (!session.getNode("/a:b").hasNode(*c:d")) {
>              System.out.println("/a:b/c:d does not exist");
>          }
>      } catch (PathNotFoundException e) {
>          System.out.println("/a:b does not exist");
>      }
>
> Currently it would end up printing "/a:b does not exist" even if the
> node /a:b did exist but the namespace prefix c didn't!
>
> BR,
>
> Jukka Zitting
>


Mime
View raw message