Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 78502 invoked from network); 13 Nov 2007 10:28:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2007 10:28:13 -0000 Received: (qmail 42547 invoked by uid 500); 13 Nov 2007 10:27:59 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 42523 invoked by uid 500); 13 Nov 2007 10:27:59 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 42514 invoked by uid 99); 13 Nov 2007 10:27:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2007 02:27:59 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2007 10:28:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2E95871423E for ; Tue, 13 Nov 2007 02:27:51 -0800 (PST) Message-ID: <13129014.1194949671188.JavaMail.jira@brutus> Date: Tue, 13 Nov 2007 02:27:51 -0800 (PST) From: "David Rauschenbach (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Updated: (JCR-1212) JCR2SPI Node.hasProperty(String) "optional property incompatibility" with Jeceira In-Reply-To: <30725608.1194813890627.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Rauschenbach updated JCR-1212: ------------------------------------ Description: 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, this); return (PropertyEntry) state.getHierarchyEntry(); } catch (ItemNotFoundException e) { return null; } catch (PathNotFoundException e) { <-- new return null; <-- new } } was: Jeceira throws a PropertyNotFoundException 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, this); return (PropertyEntry) state.getHierarchyEntry(); } catch (ItemNotFoundException e) { return null; } catch (PathNotFoundException e) { <-- new return null; <-- new } } I've corrected the typo where I mentioned a PropertyNotFoundException, which should have read PathNotFoundException. OK, I'll put together a test case. > 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, this); > 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.