You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2005/05/19 16:24:12 UTC

svn commit: r170932 - in /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: NodeImpl.java PropertyImpl.java state/NodeReferencesId.java xml/Importer.java

Author: stefan
Date: Thu May 19 07:24:11 2005
New Revision: 170932

URL: http://svn.apache.org/viewcvs?rev=170932&view=rev
Log:
- finetuning: avoid unneccessary path operations
- formatting

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/Importer.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?rev=170932&r1=170931&r2=170932&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Thu May 19 07:24:11 2005
@@ -284,7 +284,7 @@
 
     /**
      * Computes the values of well-known system (i.e. protected) properties.
-     * todo: duplicate code in WorkspaceImporter: consolidate and delegate to NodeTypeInstanceHandler
+     * todo: duplicate code in BatchedItemOperations: consolidate and delegate to NodeTypeInstanceHandler
      *
      * @param name
      * @param def
@@ -1692,15 +1692,14 @@
         sanityCheck();
 
         // check if root node
-        NodeState thisState = (NodeState) state;
-        if (thisState.getParentUUID() == null) {
+        String parentUUID = state.getParentUUID();
+        if (parentUUID == null) {
             String msg = "root node doesn't have a parent";
             log.debug(msg);
             throw new ItemNotFoundException(msg);
         }
 
-        Path path = getPrimaryPath();
-        return (Node) getAncestor(path.getAncestorCount() - 1);
+        return (Node) itemMgr.getItem(new NodeId(parentUUID));
     }
 
     //-----------------------------------------------------------------< Node >

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java?rev=170932&r1=170931&r2=170932&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java Thu May 19 07:24:11 2005
@@ -199,8 +199,10 @@
             throws ValueFormatException, VersionException,
             LockException, ConstraintViolationException,
             RepositoryException {
+        NodeImpl parent = (NodeImpl) getParent();
+
         // verify that parent node is checked-out
-        if (!((NodeImpl) getParent()).internalIsCheckedOut()) {
+        if (!parent.internalIsCheckedOut()) {
             throw new VersionException("cannot set the value of a property of a checked-in node "
                     + safeGetJCRPath());
         }
@@ -225,7 +227,7 @@
         }
 
         // check lock status
-        ((NodeImpl) getParent()).checkLock();
+        parent.checkLock();
     }
 
     /**
@@ -1122,7 +1124,6 @@
         // check state of this instance
         sanityCheck();
 
-        PropertyState thisState = (PropertyState) state;
-        return (Node) itemMgr.getItem(new NodeId(thisState.getParentUUID()));
+        return (Node) itemMgr.getItem(new NodeId(state.getParentUUID()));
     }
 }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java?rev=170932&r1=170931&r2=170932&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java Thu May 19 07:24:11 2005
@@ -69,7 +69,7 @@
      * {@inheritDoc}
      */
     public int hashCode() {
-        // use hash code of nodeid
+        // use hash code of node id
         return super.hashCode();
     }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/Importer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/Importer.java?rev=170932&r1=170931&r2=170932&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/Importer.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/Importer.java Thu May 19 07:24:11 2005
@@ -40,8 +40,8 @@
      * @param nsContext prefix mappings of current context
      * @throws RepositoryException
      */
-    void startNode(NodeInfo nodeInfo, List propInfos,
-                          NamespaceResolver nsContext) throws RepositoryException;
+    void startNode(NodeInfo nodeInfo, List propInfos, NamespaceResolver nsContext)
+            throws RepositoryException;
 
     /**
      * @param nodeInfo