Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5EB6D0DA for ; Wed, 27 Jun 2012 15:04:44 +0000 (UTC) Received: (qmail 89561 invoked by uid 500); 27 Jun 2012 15:04:44 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 89515 invoked by uid 500); 27 Jun 2012 15:04:44 -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 89507 invoked by uid 99); 27 Jun 2012 15:04:44 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2012 15:04:44 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id C0DEA1418F1 for ; Wed, 27 Jun 2012 15:04:43 +0000 (UTC) Date: Wed, 27 Jun 2012 15:04:43 +0000 (UTC) From: "Ard Schrijvers (JIRA)" To: dev@jackrabbit.apache.org Message-ID: <296251986.62178.1340809483793.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Resolved] (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 [ https://issues.apache.org/jira/browse/OCM-44?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ard Schrijvers resolved OCM-44. ------------------------------- Resolution: Won't Fix Assignee: Ard Schrijvers it returns null of does not exist, an exception if some other problem occurs > 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 > Assignee: Ard Schrijvers > > 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 RuntimeException 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. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira