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

Felix Meschberger commented on JCR-1328:
----------------------------------------

I second the proposal of Marcel and Jukka.

Re Stefan: If you want to throw on an illegal path, I would rather use 
IllegalArgumentException. This would reuse well-known exceptions and would 
absolutely match the issue (the argument is not valid).

Just throwing RepositoryException is very bad - in fact it practically 
prohibits correct exception handling, because we can of course not interpret 
the message to find out about the error.

For the record, I reopened the respective issue in JSR-283: 
https://jsr-283.dev.java.net/issues/show_bug.cgi?id=58

> Session.itemExists implementation wrong
> ---------------------------------------
>
>                 Key: JCR-1328
>                 URL: https://issues.apache.org/jira/browse/JCR-1328
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.4
>            Reporter: Felix Meschberger
>         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.

Reply via email to