Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 81417 invoked from network); 30 May 2010 17:19:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 May 2010 17:19:03 -0000 Received: (qmail 30173 invoked by uid 500); 30 May 2010 17:19:02 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 29958 invoked by uid 500); 30 May 2010 17:19:01 -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 29949 invoked by uid 99); 30 May 2010 17:19:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 May 2010 17:19:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 May 2010 17:18:59 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4UHIb1U026302 for ; Sun, 30 May 2010 17:18:37 GMT Message-ID: <3566507.73801275239917503.JavaMail.jira@thor> Date: Sun, 30 May 2010 13:18:37 -0400 (EDT) From: "Sebastian Prehn (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (OCM-44) getObjectByUuid throws exception instead of returning null as described in javadoc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org getObjectByUuid throws exception instead of returning null as described in javadoc ---------------------------------------------------------------------------------- Key: OCM-44 URL: https://issues.apache.org/jira/browse/OCM-44 Project: Jackrabbit OCM Issue Type: Bug Environment: jackrabbit-ocm 1.5.3 jackrabbit 2.0 any os Reporter: Sebastian Prehn javadoc of ObjectContentManager public Object getObjectByUuid(String uuid) sais that the method will return the object found or null. So I expected null as return value when no object with the provided id can be found. This behavior fits the behavior of other methods, such as getObject(String path). Instead I receive a ObjectContentManagerException with a wrapped ItemNotFoundException. By looking at the implementation in ObjectContentManagerImpl public Object getObjectByUuid(String uuid) { try { Node node = session.getNodeByUUID(uuid); Object object = objectConverter.getObject(session, node.getPath()); requestObjectCache.clear(); return object; } catch (RepositoryException e) { throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to get the object with uuid : " + uuid, e); } } it becomes clear that the ItemNotFoundException is not caught individually. Btw: javadoc on this methods is in sync with the code. I suggest either returning null or making the javadoc more precise on method ObjectContentManager getObjectByUuid(String uuid) best regards Sebastian -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.