You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2009/09/25 17:29:49 UTC

svn commit: r818886 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java

Author: jukka
Date: Fri Sep 25 15:29:49 2009
New Revision: 818886

URL: http://svn.apache.org/viewvc?rev=818886&view=rev
Log:
JCR-2330: Restore mix:referenceable check to SessionImpl.getNodeByUUID

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?rev=818886&r1=818885&r2=818886&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java Fri Sep 25 15:29:49 2009
@@ -60,6 +60,7 @@
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
 import org.apache.jackrabbit.spi.commons.conversion.NameException;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -851,20 +852,12 @@
     public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException {
         try {
             NodeImpl node = getNodeById(new NodeId(uuid));
-            // since the uuid of a node is only exposed through jcr:uuid declared
-            // by mix:referenceable it's rather unlikely that a client can possibly
-            // know the internal uuid of a non-referenceable node; omitting the
-            // check for mix:referenceable seems therefore to be a reasonable
-            // compromise in order to improve performance.
-            /*
-            if (node.isNodeType(Name.MIX_REFERENCEABLE)) {
+            if (node.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
                 return node;
             } else {
                 // there is a node with that uuid but the node does not expose it
-                throw new ItemNotFoundException(uuid.toString());
+                throw new ItemNotFoundException(uuid);
             }
-             */
-            return node;
         } catch (IllegalArgumentException e) {
             // Assuming the exception is from UUID.fromString()
             throw new RepositoryException("Invalid UUID: " + uuid, e);