jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r292693 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java
Date Fri, 30 Sep 2005 10:20:28 GMT
Author: mreutegg
Date: Fri Sep 30 03:20:23 2005
New Revision: 292693

URL: http://svn.apache.org/viewcvs?rev=292693&view=rev
Log:
Performance improvement
- Remove redundant check in getName(). Most calls to hasItemState() will succeed anyway and
the case where the item does not exist is also covered in getItemState().

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java?rev=292693&r1=292692&r2=292693&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java
Fri Sep 30 03:20:23 2005
@@ -373,11 +373,6 @@
         if (itemId.denotesNode()) {
             NodeId nodeId = (NodeId) itemId;
             NodeState parentState;
-            if (!hasItemState(nodeId)) {
-                String msg = "failed to resolve name of " + nodeId;
-                log.debug(msg);
-                throw new ItemNotFoundException(nodeId.toString());
-            }
             try {
                 NodeState nodeState = (NodeState) getItemState(nodeId);
                 String parentUUID = getParentUUID(nodeState);
@@ -387,6 +382,10 @@
                     return new QName(Constants.NS_DEFAULT_URI, "");
                 }
                 parentState = (NodeState) getItemState(new NodeId(parentUUID));
+            } catch (NoSuchItemStateException nsis) {
+                String msg = "failed to resolve name of " + nodeId;
+                log.debug(msg);
+                throw new ItemNotFoundException(nodeId.toString());
             } catch (ItemStateException ise) {
                 String msg = "failed to resolve name of " + nodeId;
                 log.debug(msg);



Mime
View raw message