jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1328) Session.itemExists implementation wrong
Date Fri, 29 Aug 2008 16:08:44 GMT

    [ https://issues.apache.org/jira/browse/JCR-1328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627022#action_12627022

Alexander Klimetschek commented on JCR-1328:

Stumbled over this again. It is really annoying, since this actually prevents you from checking
for valid paths in your code, since itemExists() is often called first.

> Tricky. How about adding MalformedPathException (extends RepositoryException) in jackrabbit-api,
and documenting that it will be thrown if the path is invalid?

+1 As long as JCR 2.0 does not seem to forward on this issue, wouldn't it be easier to implement
this for 1.5?

> Session.itemExists implementation wrong
> ---------------------------------------
>                 Key: JCR-1328
>                 URL: https://issues.apache.org/jira/browse/JCR-1328
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Felix Meschberger
>            Priority: Minor
>         Attachments: JCR-1328.patch
> IMHO the implementation of the Session.itemExists(String) method is wrong when called
with a malformed path such as "/a/b/c/*" (note the trailing star). According to the spec,
the method must return "false" for a malformed path like this.
> In reality, the method throws a RepositoryException which is allowed to be thrown by
the spec "if an error occurrs" (whatever that means). But catching this exception means, we
cannot handle it: Is it a connection issue or a general repository problem ? If so, I cannot
do anything about it. It is really a path problem, I can do something about it. But how do
I know (without rebuilding internals) ?
> See also SLING-152 for  more info.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message