jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
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 05:33:43 GMT
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:

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

Even though PathNotFoundException ISA RepositoryException, it has
fairly specific semantics and is thus not appropriate for all cases
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