Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 31113 invoked from network); 3 Apr 2009 14:34:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Apr 2009 14:34:18 -0000 Received: (qmail 73913 invoked by uid 500); 3 Apr 2009 14:34:18 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 73880 invoked by uid 500); 3 Apr 2009 14:34:18 -0000 Mailing-List: contact commits-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 commits@jackrabbit.apache.org Received: (qmail 73871 invoked by uid 99); 3 Apr 2009 14:34:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 14:34:18 +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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 14:34:17 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7CBF623888E7; Fri, 3 Apr 2009 14:33:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761695 - /jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java Date: Fri, 03 Apr 2009 14:33:57 -0000 To: commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090403143357.7CBF623888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jukka Date: Fri Apr 3 14:33:57 2009 New Revision: 761695 URL: http://svn.apache.org/viewvc?rev=761695&view=rev Log: JCRRMI-15: Property.getNode() should throw ValueFormatException on non-UUID values This fixes 6 TCK test failures. Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java?rev=761695&r1=761694&r2=761695&view=diff ============================================================================== --- jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java (original) +++ jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java Fri Apr 3 14:33:57 2009 @@ -20,12 +20,15 @@ import java.rmi.RemoteException; import java.util.Calendar; +import javax.jcr.ItemNotFoundException; import javax.jcr.ItemVisitor; import javax.jcr.Node; import javax.jcr.Property; +import javax.jcr.PropertyType; import javax.jcr.RepositoryException; import javax.jcr.Session; import javax.jcr.Value; +import javax.jcr.ValueFormatException; import javax.jcr.nodetype.PropertyDefinition; import org.apache.jackrabbit.rmi.remote.RemoteProperty; @@ -286,7 +289,18 @@ * {@inheritDoc} */ public Node getNode() throws RepositoryException { - return getSession().getNodeByUUID(getString()); + String uuid = getString(); + try { + return getSession().getNodeByUUID(uuid); + } catch (RepositoryException e) { + // JCRRMI-15: Throw ValueFormatException where appropriate + if (e instanceof ItemNotFoundException + || getType() == PropertyType.REFERENCE) { + throw e; + } else { + throw new ValueFormatException("Invalid UUID: " + uuid, e); + } + } } /** {@inheritDoc} */