jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Reschke (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1212) JCR2SPI Node.hasProperty(String) "optional property incompatibility" with Jeceira
Date Tue, 13 Nov 2007 12:28:50 GMT

    [ https://issues.apache.org/jira/browse/JCR-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542128

Julian Reschke commented on JCR-1212:

I always get confused about PathNotFoundExceptions and ItemNotFoundExceptions :-)

That being said, we should agree on what is correct, and then either fix SPI2JCR or Jeceira
(that's open source too, right?).

> JCR2SPI Node.hasProperty(String) "optional property incompatibility" with Jeceira
> ---------------------------------------------------------------------------------
>                 Key: JCR-1212
>                 URL: https://issues.apache.org/jira/browse/JCR-1212
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>    Affects Versions: 1.4
>         Environment: 1.4-SNAPSHOT
>            Reporter: David Rauschenbach
>            Priority: Minor
> Jeceira throws a PathNotFoundException when an SPI2JCR-wrapped Jeceira repository gets
invoked with the SPI getPropertyInfo, specifying an optional property that does not exist
for a given node instance.
> JCR2SPI only expects an ItemNotFoundException to be thrown in such a case, which prevents
Node.hasProperty(String) from returning true/false, and instead results in a RepositoryException
being thrown, which in effect is an interoperability issue.
> JCR2SPI compatibility with Jeceira-based repositories would be significantly improved
if the code in NodeEntryImpl.java:loadPropertyEntry(PropertyId) caught not only ItemNotFoundException,
but also PathNotFoundException, before returning null in both cases.
> Proposed change to NodeEntryImpl.java:
>     private PropertyEntry loadPropertyEntry(PropertyId childId) throws RepositoryException
>         try {
>             PropertyState state = factory.getItemStateFactory().createDeepPropertyState(childId,
>             return (PropertyEntry) state.getHierarchyEntry();
>         } catch (ItemNotFoundException e) {
>             return null;
>         } catch (PathNotFoundException e) { <-- new
>             return null; <-- new
>         }
>     }

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

View raw message