jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r156666 [1/2] - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: ./ nodetype/ search/lucene/ search/xpath/ state/ state/obj/ util/ version/ version/persistence/ virtual/ xml/
Date Wed, 09 Mar 2005 18:36:26 GMT
Author: stefan
Date: Wed Mar  9 10:36:14 2005
New Revision: 156666

URL: http://svn.apache.org/viewcvs?view=rev&rev=156666
Log:
- re-implementing Workspace methods (-> work in progress!)
- avoiding "#import bla.*" stmts (in accordance with checkstyle settings)

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/InternalValue.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefStore.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/LuceneQueryBuilder.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/QueryFormat.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/XPathQueryBuilder.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferences.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PropertyState.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Base64.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualItemStateProvider.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/AbstractSAXEventGenerator.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/InternalValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/InternalValue.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/InternalValue.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/InternalValue.java Wed Mar  9 10:36:14 2005
@@ -20,7 +20,19 @@
 import org.apache.jackrabbit.core.util.ValueHelper;
 import org.apache.jackrabbit.core.util.uuid.UUID;
 
-import javax.jcr.*;
+import javax.jcr.BinaryValue;
+import javax.jcr.BooleanValue;
+import javax.jcr.DateValue;
+import javax.jcr.DoubleValue;
+import javax.jcr.LongValue;
+import javax.jcr.NameValue;
+import javax.jcr.PathValue;
+import javax.jcr.PropertyType;
+import javax.jcr.ReferenceValue;
+import javax.jcr.RepositoryException;
+import javax.jcr.StringValue;
+import javax.jcr.Value;
+import javax.jcr.ValueFormatException;
 import javax.jcr.util.ISO8601;
 import java.io.File;
 import java.io.IOException;

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?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Wed Mar  9 10:36:14 2005
@@ -1217,7 +1217,8 @@
     protected Property internalSetProperty(QName name, InternalValue[] values)
             throws ValueFormatException, RepositoryException {
         int type;
-        if (values == null || values.length == 0) {
+        if (values == null || values.length == 0
+                || values[0] == null) {
             type = PropertyType.UNDEFINED;
         } else {
             type = values[0].getType();
@@ -1441,7 +1442,8 @@
             throws ValueFormatException, VersionException, LockException,
             RepositoryException {
         int type;
-        if (values == null || values.length == 0) {
+        if (values == null || values.length == 0
+                || values[0] == null) {
             type = PropertyType.UNDEFINED;
         } else {
             type = values[0].getType();
@@ -1762,7 +1764,8 @@
             throws ValueFormatException, VersionException, LockException,
             RepositoryException {
         int type;
-        if (values == null || values.length == 0) {
+        if (values == null || values.length == 0
+                || values[0] == null) {
             type = PropertyType.UNDEFINED;
         } else {
             type = values[0].getType();

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java Wed Mar  9 10:36:14 2005
@@ -34,7 +34,6 @@
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
 import org.apache.jackrabbit.core.state.TransactionalItemStateManager;
-import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
 import org.apache.jackrabbit.core.util.uuid.UUID;
 import org.apache.jackrabbit.core.xml.ImportHandler;
 import org.apache.log4j.Logger;
@@ -194,167 +193,23 @@
         session.createWorkspace(workspaceName);
     }
 
-    //-----------< misc. static helper methods for cross-workspace operations >
-    /**
-     * @param nodePath
-     * @param nsResolver
-     * @param hierMgr
-     * @param stateMgr
-     * @return
-     * @throws PathNotFoundException
-     * @throws RepositoryException
-     */
-    protected static NodeState getNodeState(String nodePath,
-                                            NamespaceResolver nsResolver,
-                                            HierarchyManagerImpl hierMgr,
-                                            ItemStateManager stateMgr)
-            throws PathNotFoundException, RepositoryException {
-        try {
-            return getNodeState(Path.create(nodePath, nsResolver, true), hierMgr, stateMgr);
-        } catch (MalformedPathException mpe) {
-            String msg = "invalid path: " + nodePath;
-            log.debug(msg);
-            throw new RepositoryException(msg, mpe);
-        }
-    }
-
-    /**
-     * @param path
-     * @param nsResolver
-     * @param hierMgr
-     * @param stateMgr
-     * @return
-     * @throws PathNotFoundException
-     * @throws RepositoryException
-     */
-    protected static NodeState getParentNodeState(String path,
-                                                  NamespaceResolver nsResolver,
-                                                  HierarchyManagerImpl hierMgr,
-                                                  ItemStateManager stateMgr)
-
-            throws PathNotFoundException, RepositoryException {
-        try {
-            return getNodeState(Path.create(path, nsResolver, true).getAncestor(1), hierMgr, stateMgr);
-        } catch (MalformedPathException mpe) {
-            String msg = "invalid path: " + path;
-            log.debug(msg);
-            throw new RepositoryException(msg, mpe);
-        }
-    }
-
-    /**
-     * @param nodePath
-     * @param hierMgr
-     * @param stateMgr
-     * @return
-     * @throws PathNotFoundException
-     * @throws RepositoryException
-     */
-    protected static NodeState getNodeState(Path nodePath,
-                                            HierarchyManagerImpl hierMgr,
-                                            ItemStateManager stateMgr)
-            throws PathNotFoundException, RepositoryException {
-        try {
-            ItemId id = hierMgr.resolvePath(nodePath);
-            if (!id.denotesNode()) {
-                throw new PathNotFoundException(hierMgr.safeGetJCRPath(nodePath));
-            }
-            return getNodeState((NodeId) id, stateMgr);
-        } catch (NoSuchItemStateException nsise) {
-            throw new PathNotFoundException(hierMgr.safeGetJCRPath(nodePath));
-        } catch (ItemStateException ise) {
-            String msg = "internal error: failed to retrieve state of " + hierMgr.safeGetJCRPath(nodePath);
-            log.debug(msg);
-            throw new RepositoryException(msg, ise);
-        }
-    }
-
-    /**
-     * @param id
-     * @param stateMgr
-     * @return
-     * @throws NoSuchItemStateException
-     * @throws ItemStateException
-     */
-    protected static NodeState getNodeState(NodeId id,
-                                            ItemStateManager stateMgr)
-            throws NoSuchItemStateException, ItemStateException {
-        return (NodeState) stateMgr.getItemState(id);
-    }
-
-    /**
-     * Verifies that the node at <code>nodePath</code> is checked-out; throws a
-     * <code>VersionException</code> if that's not the case.
-     * <p/>
-     * A node is considered <i>checked-out</i> if it is versionable and
-     * checked-out, or is non-versionable but its nearest versionable ancestor
-     * is checked-out, or is non-versionable and there are no versionable
-     * ancestors.
-     *
-     * @param nodePath
-     * @param hierMgr
-     * @param stateMgr
-     * @throws VersionException
-     * @throws RepositoryException
-     */
-    protected static void verifyCheckedOut(Path nodePath,
-                                           HierarchyManagerImpl hierMgr,
-                                           ItemStateManager stateMgr)
-            throws VersionException, RepositoryException {
-        // search nearest ancestor that is versionable, start with node at nodePath
-        /**
-         * FIXME should not only rely on existence of jcr:isCheckedOut property
-         * but also verify that node.isNodeType("mix:versionable")==true;
-         * this would have a negative impact on performance though...
-         */
-        NodeState nodeState = getNodeState(nodePath, hierMgr, stateMgr);
-        while (!nodeState.hasPropertyEntry(JCR_ISCHECKEDOUT)) {
-            if (nodePath.denotesRoot()) {
-                return;
-            }
-            nodePath = nodePath.getAncestor(1);
-            nodeState = getNodeState(nodePath, hierMgr, stateMgr);
-        }
-        PropertyId propId =
-                new PropertyId(nodeState.getUUID(), JCR_ISCHECKEDOUT);
-        PropertyState propState;
-        try {
-            propState = (PropertyState) stateMgr.getItemState(propId);
-        } catch (ItemStateException ise) {
-            String msg = "internal error: failed to retrieve state of "
-                    + hierMgr.safeGetJCRPath(propId);
-            log.debug(msg);
-            throw new RepositoryException(msg, ise);
-        }
-        boolean checkedOut = ((Boolean) propState.getValues()[0].internalValue()).booleanValue();
-        if (!checkedOut) {
-            throw new VersionException(hierMgr.safeGetJCRPath(nodePath) + " is checked-in");
-        }
-    }
-
     /**
      * @param nodePath
      * @param nodeTypeName
-     * @param ntReg
-     * @param accessMgr
-     * @param hierMgr
-     * @param stateMgr
      * @throws ConstraintViolationException
      * @throws AccessDeniedException
      * @throws PathNotFoundException
      * @throws ItemExistsException
      * @throws RepositoryException
      */
-    protected static void checkAddNode(Path nodePath, QName nodeTypeName,
-                                       NodeTypeRegistry ntReg,
-                                       AccessManager accessMgr,
-                                       HierarchyManagerImpl hierMgr,
-                                       ItemStateManager stateMgr)
+    protected void checkAddNode(Path nodePath, QName nodeTypeName)
             throws ConstraintViolationException, AccessDeniedException,
             PathNotFoundException, ItemExistsException, RepositoryException {
 
+        AccessManager accessMgr = session.getAccessManager();
+
         Path parentPath = nodePath.getAncestor(1);
-        NodeState parentState = getNodeState(parentPath, hierMgr, stateMgr);
+        NodeState parentState = getNodeState(parentPath);
 
         // 1. check path & access rights
 
@@ -368,20 +223,23 @@
                 throw new AccessDeniedException(hierMgr.safeGetJCRPath(parentPath) + ": not allowed to add child node");
             }
         } catch (ItemNotFoundException infe) {
-            String msg = "internal error: failed to check access rights for " + hierMgr.safeGetJCRPath(parentPath);
+            String msg = "internal error: failed to check access rights for "
+                    + hierMgr.safeGetJCRPath(parentPath);
             log.debug(msg);
             throw new RepositoryException(msg, infe);
         }
 
         // 2. check node type constraints
 
+        NodeTypeRegistry ntReg = rep.getNodeTypeRegistry();
         ChildNodeDef parentDef = ntReg.getNodeDef(parentState.getDefinitionId());
         if (parentDef.isProtected()) {
             throw new ConstraintViolationException(hierMgr.safeGetJCRPath(parentPath) + ": cannot add child node to protected parent node");
         }
-        EffectiveNodeType entParent = getEffectiveNodeType(parentState, ntReg);
+        EffectiveNodeType entParent = getEffectiveNodeType(parentState);
         entParent.checkAddNodeConstraints(nodeName.getName(), nodeTypeName);
-        ChildNodeDef newNodeDef = findApplicableDefinition(nodeName.getName(), nodeTypeName, parentState, ntReg);
+        ChildNodeDef newNodeDef =
+                findApplicableDefinition(nodeName.getName(), nodeTypeName, parentState);
 
         // 3. check for name collisions
 
@@ -414,26 +272,20 @@
 
     /**
      * @param nodePath
-     * @param ntReg
-     * @param accessMgr
-     * @param hierMgr
-     * @param stateMgr
      * @throws ConstraintViolationException
      * @throws AccessDeniedException
      * @throws PathNotFoundException
      * @throws RepositoryException
      */
-    protected static void checkRemoveNode(Path nodePath,
-                                          NodeTypeRegistry ntReg,
-                                          AccessManager accessMgr,
-                                          HierarchyManagerImpl hierMgr,
-                                          ItemStateManager stateMgr)
+    protected void checkRemoveNode(Path nodePath)
             throws ConstraintViolationException, AccessDeniedException,
             PathNotFoundException, RepositoryException {
 
-        NodeState targetState = getNodeState(nodePath, hierMgr, stateMgr);
+        AccessManager accessMgr = session.getAccessManager();
+
+        NodeState targetState = getNodeState(nodePath);
         Path parentPath = nodePath.getAncestor(1);
-        NodeState parentState = getNodeState(parentPath, hierMgr, stateMgr);
+        NodeState parentState = getNodeState(parentPath);
 
         // 1. check path & access rights
 
@@ -453,6 +305,7 @@
 
         // 2. check node type constraints
 
+        NodeTypeRegistry ntReg = rep.getNodeTypeRegistry();
         ChildNodeDef parentDef = ntReg.getNodeDef(parentState.getDefinitionId());
         if (parentDef.isProtected()) {
             throw new ConstraintViolationException(hierMgr.safeGetJCRPath(parentPath) + ": cannot remove child node of protected parent node");
@@ -467,27 +320,98 @@
     }
 
     /**
+     * Verifies that the node at <code>nodePath</code> is checked-out; throws a
+     * <code>VersionException</code> if that's not the case.
+     * <p/>
+     * A node is considered <i>checked-out</i> if it is versionable and
+     * checked-out, or is non-versionable but its nearest versionable ancestor
+     * is checked-out, or is non-versionable and there are no versionable
+     * ancestors.
+     *
+     * @param nodePath
+     * @throws VersionException
+     * @throws RepositoryException
+     */
+    protected void verifyCheckedOut(Path nodePath)
+            throws VersionException, RepositoryException {
+        // search nearest ancestor that is versionable, start with node at nodePath
+        /**
+         * FIXME should not only rely on existence of jcr:isCheckedOut property
+         * but also verify that node.isNodeType("mix:versionable")==true;
+         * this would have a negative impact on performance though...
+         */
+        NodeState nodeState = getNodeState(nodePath);
+        while (!nodeState.hasPropertyEntry(JCR_ISCHECKEDOUT)) {
+            if (nodePath.denotesRoot()) {
+                return;
+            }
+            nodePath = nodePath.getAncestor(1);
+            nodeState = getNodeState(nodePath);
+        }
+        PropertyId propId =
+                new PropertyId(nodeState.getUUID(), JCR_ISCHECKEDOUT);
+        PropertyState propState;
+        try {
+            propState = (PropertyState) stateMgr.getItemState(propId);
+        } catch (ItemStateException ise) {
+            String msg = "internal error: failed to retrieve state of "
+                    + hierMgr.safeGetJCRPath(propId);
+            log.debug(msg);
+            throw new RepositoryException(msg, ise);
+        }
+        boolean checkedOut = ((Boolean) propState.getValues()[0].internalValue()).booleanValue();
+        if (!checkedOut) {
+            throw new VersionException(hierMgr.safeGetJCRPath(nodePath) + " is checked-in");
+        }
+    }
+
+    /**
+     * @param nodePath
+     * @return
+     * @throws PathNotFoundException
+     * @throws RepositoryException
+     */
+    protected NodeState getNodeState(Path nodePath)
+            throws PathNotFoundException, RepositoryException {
+        try {
+            ItemId id = hierMgr.resolvePath(nodePath);
+            if (!id.denotesNode()) {
+                throw new PathNotFoundException(hierMgr.safeGetJCRPath(nodePath));
+            }
+            return (NodeState) stateMgr.getItemState(id);
+        } catch (NoSuchItemStateException nsise) {
+            throw new PathNotFoundException(hierMgr.safeGetJCRPath(nodePath));
+        } catch (ItemStateException ise) {
+            String msg = "internal error: failed to retrieve state of "
+                    + hierMgr.safeGetJCRPath(nodePath);
+            log.debug(msg);
+            throw new RepositoryException(msg, ise);
+        }
+    }
+
+    /**
      * Helper method that builds the effective (i.e. merged and resolved)
      * node type representation of the specified node's primary and mixin
      * node types.
      *
      * @param state
-     * @param ntReg
      * @return the effective node type
      * @throws RepositoryException
      */
-    protected static EffectiveNodeType getEffectiveNodeType(NodeState state,
-                                                            NodeTypeRegistry ntReg)
+    protected EffectiveNodeType getEffectiveNodeType(NodeState state)
             throws RepositoryException {
         // build effective node type of mixins & primary type:
         // existing mixin's
         HashSet set = new HashSet((state).getMixinTypeNames());
         // primary type
         set.add(state.getNodeTypeName());
+        NodeTypeRegistry ntReg = rep.getNodeTypeRegistry();
         try {
             return ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
         } catch (NodeTypeConflictException ntce) {
-            String msg = "internal error: failed to build effective node type for node " + state.getUUID();
+            String msg =
+                    "internal error: failed to build effective node type for node "
+                    + state.getUUID();
             log.debug(msg);
             throw new RepositoryException(msg, ntce);
         }
@@ -501,28 +425,23 @@
      * @param name
      * @param nodeTypeName
      * @param parentState
-     * @param ntReg
      * @return a <code>ChildNodeDef</code>
      * @throws ConstraintViolationException if no applicable child node definition
      *                                      could be found
      * @throws RepositoryException          if another error occurs
      */
-    protected static ChildNodeDef findApplicableDefinition(QName name,
-                                                           QName nodeTypeName,
-                                                           NodeState parentState,
-                                                           NodeTypeRegistry ntReg)
+    protected ChildNodeDef findApplicableDefinition(QName name,
+                                                    QName nodeTypeName,
+                                                    NodeState parentState)
             throws RepositoryException, ConstraintViolationException {
-        EffectiveNodeType entParent = getEffectiveNodeType(parentState, ntReg);
+        EffectiveNodeType entParent = getEffectiveNodeType(parentState);
         return entParent.getApplicableChildNodeDef(name, nodeTypeName);
     }
 
-    private static NodeState copyNodeState(NodeState srcState,
-                                           String parentUUID,
-                                           NodeTypeRegistry ntReg,
-                                           HierarchyManagerImpl srcHierMgr,
-                                           ItemStateManager srcStateMgr,
-                                           UpdatableItemStateManager destStateMgr,
-                                           boolean clone)
+    private NodeState copyNodeState(NodeState srcState,
+                                    String parentUUID,
+                                    ItemStateManager srcStateMgr,
+                                    boolean clone)
             throws RepositoryException {
 
         NodeState newState;
@@ -531,9 +450,14 @@
             if (clone) {
                 uuid = srcState.getUUID();
             } else {
+                /**
+                 * todo FIXME check mix:referenceable
+                 * make sure that copied reference properties are
+                 * refering to new uuid
+                 */
                 uuid = UUID.randomUUID().toString();	// create new version 4 uuid
             }
-            newState = destStateMgr.createNew(uuid, srcState.getNodeTypeName(), parentUUID);
+            newState = stateMgr.createNew(uuid, srcState.getNodeTypeName(), parentUUID);
             // copy node state
             // @todo special handling required for nodes with special semantics (e.g. those defined by mix:versionable, et.al.)
             // FIXME delegate to 'node type instance handler'
@@ -543,12 +467,13 @@
             Iterator iter = srcState.getChildNodeEntries().iterator();
             while (iter.hasNext()) {
                 NodeState.ChildNodeEntry entry = (NodeState.ChildNodeEntry) iter.next();
-                NodeState srcChildState = (NodeState) srcStateMgr.getItemState(new NodeId(entry.getUUID()));
+                NodeState srcChildState =
+                        (NodeState) srcStateMgr.getItemState(new NodeId(entry.getUUID()));
                 // recursive copying of child node
                 NodeState newChildState = copyNodeState(srcChildState, uuid,
-                        ntReg, srcHierMgr, srcStateMgr, destStateMgr, clone);
+                        srcStateMgr, clone);
                 // persist new child node
-                destStateMgr.store(newChildState);
+                stateMgr.store(newChildState);
                 // add new child node entry to new node
                 newState.addChildNodeEntry(entry.getName(), newChildState.getUUID());
             }
@@ -556,33 +481,30 @@
             iter = srcState.getPropertyEntries().iterator();
             while (iter.hasNext()) {
                 NodeState.PropertyEntry entry = (NodeState.PropertyEntry) iter.next();
-                PropertyState srcChildState = (PropertyState) srcStateMgr.getItemState(new PropertyId(srcState.getUUID(), entry.getName()));
-                PropertyState newChildState = copyPropertyState(srcChildState, uuid, entry.getName(),
-                        ntReg, srcHierMgr, srcStateMgr, destStateMgr);
+                PropertyState srcChildState =
+                        (PropertyState) srcStateMgr.getItemState(new PropertyId(srcState.getUUID(), entry.getName()));
+                PropertyState newChildState =
+                        copyPropertyState(srcChildState, uuid, entry.getName());
                 // persist new property
-                destStateMgr.store(newChildState);
+                stateMgr.store(newChildState);
                 // add new property entry to new node
                 newState.addPropertyEntry(entry.getName());
             }
             return newState;
         } catch (ItemStateException ise) {
-            String msg = "internal error: failed to copy state of " + srcHierMgr.safeGetJCRPath(srcState.getId());
+            String msg = "internal error: failed to copy state of " + srcState.getId();
             log.debug(msg);
             throw new RepositoryException(msg, ise);
         }
     }
 
-    private static PropertyState copyPropertyState(PropertyState srcState,
-                                                   String parentUUID,
-                                                   QName propName,
-                                                   NodeTypeRegistry ntReg,
-                                                   HierarchyManagerImpl srcHierMgr,
-                                                   ItemStateManager srcStateMgr,
-                                                   UpdatableItemStateManager destStateMgr)
+    private PropertyState copyPropertyState(PropertyState srcState,
+                                            String parentUUID,
+                                            QName propName)
             throws RepositoryException {
 
         // @todo special handling required for properties with special semantics (e.g. those defined by mix:versionable, mix:lockable, et.al.)
-        PropertyState newState = destStateMgr.createNew(propName, parentUUID);
+        PropertyState newState = stateMgr.createNew(propName, parentUUID);
         PropDefId defId = srcState.getDefinitionId();
         newState.setDefinitionId(defId);
         newState.setType(srcState.getType());
@@ -596,7 +518,7 @@
             newState.setValues(values);
             // FIXME delegate to 'node type instance handler'
             if (defId != null) {
-                PropDef def = ntReg.getPropDef(defId);
+                PropDef def = rep.getNodeTypeRegistry().getPropDef(defId);
                 if (def.getDeclaringNodeType().equals(MIX_REFERENCEABLE)) {
                     if (propName.equals(JCR_UUID)) {
                         // set correct value of jcr:uuid property
@@ -608,16 +530,10 @@
         return newState;
     }
 
-    private static void internalCopy(String srcAbsPath,
-                                     ItemStateManager srcStateMgr,
-                                     HierarchyManagerImpl srcHierMgr,
-                                     String destAbsPath,
-                                     UpdatableItemStateManager destStateMgr,
-                                     HierarchyManagerImpl destHierMgr,
-                                     AccessManager accessMgr,
-                                     NamespaceResolver nsResolver,
-                                     NodeTypeRegistry ntReg,
-                                     boolean clone)
+    private void internalCopy(String srcAbsPath,
+                              WorkspaceImpl srcWsp,
+                              String destAbsPath,
+                              boolean clone)
             throws ConstraintViolationException, AccessDeniedException,
             VersionException, PathNotFoundException, ItemExistsException,
             LockException, RepositoryException {
@@ -627,8 +543,8 @@
         Path srcPath;
         NodeState srcState;
         try {
-            srcPath = Path.create(srcAbsPath, nsResolver, true);
-            srcState = getNodeState(srcPath, srcHierMgr, srcStateMgr);
+            srcPath = Path.create(srcAbsPath, session.getNamespaceResolver(), true);
+            srcState = srcWsp.getNodeState(srcPath);
         } catch (MalformedPathException mpe) {
             String msg = "invalid path: " + srcAbsPath;
             log.debug(msg);
@@ -640,10 +556,10 @@
         Path destParentPath;
         NodeState destParentState;
         try {
-            destPath = Path.create(destAbsPath, nsResolver, true);
+            destPath = Path.create(destAbsPath, session.getNamespaceResolver(), true);
             destName = destPath.getNameElement();
             destParentPath = destPath.getAncestor(1);
-            destParentState = getNodeState(destParentPath, destHierMgr, destStateMgr);
+            destParentState = getNodeState(destParentPath);
         } catch (MalformedPathException mpe) {
             String msg = "invalid path: " + destAbsPath;
             log.debug(msg);
@@ -652,13 +568,14 @@
         int ind = destName.getIndex();
         if (ind > 0) {
             // subscript in name element
-            String msg = destAbsPath + ": invalid destination path (subscript in name element is not allowed)";
+            String msg = destAbsPath
+                    + ": invalid destination path (subscript in name element is not allowed)";
             log.debug(msg);
             throw new RepositoryException(msg);
         }
 
         // make sure destination parent node is checked-out
-        verifyCheckedOut(destParentPath, destHierMgr, destStateMgr);
+        verifyCheckedOut(destParentPath);
 
         // @todo check locked-status
 
@@ -666,7 +583,7 @@
 
         try {
             // check read access right on source node
-            if (!accessMgr.isGranted(srcState.getId(), AccessManager.READ)) {
+            if (!session.getAccessManager().isGranted(srcState.getId(), AccessManager.READ)) {
                 throw new PathNotFoundException(srcAbsPath);
             }
         } catch (ItemNotFoundException infe) {
@@ -675,29 +592,32 @@
             throw new RepositoryException(msg, infe);
         }
         // check node type constraints
-        checkAddNode(destPath, srcState.getNodeTypeName(), ntReg, accessMgr, destHierMgr, destStateMgr);
+        checkAddNode(destPath, srcState.getNodeTypeName());
 
         // 3. do copy operation (modify and persist affected states)
+
         try {
-            destStateMgr.edit();
+            stateMgr.edit();
 
             // create deep copy of source node state
             NodeState newState = copyNodeState(srcState, destParentState.getUUID(),
-                    ntReg, srcHierMgr, srcStateMgr, destStateMgr, clone);
+                    srcWsp.getItemStateManager(), clone);
 
             // add to new parent
             destParentState.addChildNodeEntry(destName.getName(), newState.getUUID());
 
             // change definition (id) of new node
-            ChildNodeDef newNodeDef = findApplicableDefinition(destName.getName(), srcState.getNodeTypeName(), destParentState, ntReg);
+            ChildNodeDef newNodeDef =
+                    findApplicableDefinition(destName.getName(),
+                            srcState.getNodeTypeName(), destParentState);
             newState.setDefinitionId(new NodeDefId(newNodeDef));
 
             // persist states
-            destStateMgr.store(newState);
-            destStateMgr.store(destParentState);
+            stateMgr.store(newState);
+            stateMgr.store(destParentState);
 
             // finish update operations
-            destStateMgr.update();
+            stateMgr.update();
         } catch (ItemStateException ise) {
             String msg = "internal error: failed to persist state of " + destAbsPath;
             log.debug(msg);
@@ -752,19 +672,26 @@
         // check state of this instance
         sanityCheck();
 
-        // @todo reimplement Workspace#clone according to new spec
+        // check workspace name
+        if (getName().equals(srcWorkspace)) {
+            // same as current workspace
+            String msg = srcWorkspace + ": illegal workspace (same as current)";
+            log.debug(msg);
+            throw new RepositoryException(msg);
+        }
+
+        // @todo re-implement Workspace#clone (respect new removeExisting flag, etc)
 
         // clone (i.e. pull) subtree at srcAbsPath from srcWorkspace
         // to 'this' workspace at destAbsPath
-        ItemStateManager srcStateMgr = rep.getWorkspaceStateManager(srcWorkspace);
-        // FIXME need to setup a hierarchy manager for source workspace
-        HierarchyManagerImpl srcHierMgr =
-                new HierarchyManagerImpl(rep.getRootNodeUUID(), srcStateMgr, session.getNamespaceResolver());
+
+        // aquire session on other workspace (throws NoSuchWorkspaceException)
+        // @todo FIXME need to get session with same credentials as current
+        SessionImpl srcSession = rep.getSystemSession(srcWorkspace);
+        WorkspaceImpl srcWsp = (WorkspaceImpl) srcSession.getWorkspace();
+
         // do cross-workspace copy
-        internalCopy(srcAbsPath, srcStateMgr, srcHierMgr,
-                destAbsPath, stateMgr, hierMgr,
-                session.getAccessManager(), session.getNamespaceResolver(),
-                rep.getNodeTypeRegistry(), true);
+        internalCopy(srcAbsPath, srcWsp, destAbsPath, true);
     }
 
     /**
@@ -779,10 +706,7 @@
         sanityCheck();
 
         // do intra-workspace copy
-        internalCopy(srcAbsPath, stateMgr, hierMgr,
-                destAbsPath, stateMgr, hierMgr,
-                session.getAccessManager(), session.getNamespaceResolver(),
-                rep.getNodeTypeRegistry(), false);
+        internalCopy(srcAbsPath, this, destAbsPath, false);
     }
 
     /**
@@ -796,16 +720,23 @@
         // check state of this instance
         sanityCheck();
 
+        // check workspace name
+        if (getName().equals(srcWorkspace)) {
+            // same as current workspace, delegate to intra-workspace copy method
+            copy(srcAbsPath, destAbsPath);
+            return;
+        }
+
         // copy (i.e. pull) subtree at srcAbsPath from srcWorkspace
         // to 'this' workspace at destAbsPath
-        ItemStateManager srcStateMgr = rep.getWorkspaceStateManager(srcWorkspace);
-        // FIXME need to setup a hierarchy manager for source workspace
-        HierarchyManagerImpl srcHierMgr = new HierarchyManagerImpl(rep.getRootNodeUUID(), srcStateMgr, session.getNamespaceResolver());
+
+        // aquire session on other workspace (throws NoSuchWorkspaceException)
+        // @todo FIXME need to get session with same credentials as current
+        SessionImpl srcSession = rep.getSystemSession(srcWorkspace);
+        WorkspaceImpl srcWsp = (WorkspaceImpl) srcSession.getWorkspace();
+
         // do cross-workspace copy
-        internalCopy(srcAbsPath, srcStateMgr, srcHierMgr,
-                destAbsPath, stateMgr, hierMgr,
-                session.getAccessManager(), session.getNamespaceResolver(),
-                rep.getNodeTypeRegistry(), false);
+        internalCopy(srcAbsPath, srcWsp, destAbsPath, false);
     }
 
     /**
@@ -832,8 +763,8 @@
             srcPath = Path.create(srcAbsPath, session.getNamespaceResolver(), true);
             srcName = srcPath.getNameElement();
             srcParentPath = srcPath.getAncestor(1);
-            targetState = getNodeState(srcPath, hierMgr, stateMgr);
-            srcParentState = getNodeState(srcParentPath, hierMgr, stateMgr);
+            targetState = getNodeState(srcPath);
+            srcParentState = getNodeState(srcParentPath);
         } catch (MalformedPathException mpe) {
             String msg = "invalid path: " + srcAbsPath;
             log.debug(msg);
@@ -854,7 +785,7 @@
             }
             destName = destPath.getNameElement();
             destParentPath = destPath.getAncestor(1);
-            destParentState = getNodeState(destParentPath, hierMgr, stateMgr);
+            destParentState = getNodeState(destParentPath);
         } catch (MalformedPathException mpe) {
             String msg = "invalid path: " + destAbsPath;
             log.debug(msg);
@@ -870,18 +801,15 @@
         }
 
         // make sure both source & destination parent nodes are checked-out
-        verifyCheckedOut(srcParentPath, hierMgr, stateMgr);
-        verifyCheckedOut(destParentPath, hierMgr, stateMgr);
+        verifyCheckedOut(srcParentPath);
+        verifyCheckedOut(destParentPath);
 
         // @todo check locked-status
 
         // 2. check node type constraints & access rights
 
-        checkRemoveNode(srcPath, rep.getNodeTypeRegistry(),
-                session.getAccessManager(), hierMgr, stateMgr);
-        checkAddNode(destPath, targetState.getNodeTypeName(),
-                rep.getNodeTypeRegistry(), session.getAccessManager(),
-                hierMgr, stateMgr);
+        checkRemoveNode(srcPath);
+        checkAddNode(destPath, targetState.getNodeTypeName());
 
         // 3. do move operation (modify and persist affected states)
         try {
@@ -895,7 +823,7 @@
             destParentState.addChildNodeEntry(destName.getName(), targetState.getUUID());
 
             // change definition (id) of target node
-            ChildNodeDef newTargetDef = findApplicableDefinition(destName.getName(), targetState.getNodeTypeName(), destParentState, rep.getNodeTypeRegistry());
+            ChildNodeDef newTargetDef = findApplicableDefinition(destName.getName(), targetState.getNodeTypeName(), destParentState);
             targetState.setDefinitionId(new NodeDefId(newTargetDef));
 
             // remove from old parent
@@ -1008,6 +936,27 @@
 
         // check state of this instance
         sanityCheck();
+
+        // check path & retrieve state
+        Path targetPath;
+        NodeState targetState;
+
+        try {
+            targetPath = Path.create(parentAbsPath, session.getNamespaceResolver(), true);
+            targetState = getNodeState(targetPath);
+        } catch (MalformedPathException mpe) {
+            String msg = "invalid path: " + parentAbsPath;
+            log.debug(msg);
+            throw new RepositoryException(msg, mpe);
+        }
+
+        // make sure target node is checked-out
+        verifyCheckedOut(targetPath);
+
+        // @todo check locked-status
+
+        // check node type constraints & access rights
+        checkAddNode(targetPath, targetState.getNodeTypeName());
 
         // @todo implement Workspace#getImportContentHandler
         throw new RepositoryException("not yet implemented");

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java Wed Mar  9 10:36:14 2005
@@ -729,18 +729,53 @@
             List existingDefs = (List) namedItemDefs.get(name);
             if (existingDefs != null) {
                 if (existingDefs.size() > 0) {
-                    /**
-                     * there already exists at least one definition with that
-                     * name; make sure none of them is auto-create
-                     */
+                    // there already exists at least one definition with that name
                     for (int j = 0; j < existingDefs.size(); j++) {
                         ChildItemDef existingDef = (ChildItemDef) existingDefs.get(j);
+                        // make sure none of them is auto-create
                         if (def.isAutoCreate() || existingDef.isAutoCreate()) {
                             // conflict
-                            String msg = "The item definition for '" + name + "' in node type '" + def.getDeclaringNodeType() + "' conflicts with node type '" + existingDef.getDeclaringNodeType() + "': name collision with auto-create definition";
+                            String msg = "The item definition for '" + name
+                                    + "' in node type '"
+                                    + def.getDeclaringNodeType()
+                                    + "' conflicts with node type '"
+                                    + existingDef.getDeclaringNodeType()
+                                    + "': name collision with auto-create definition";
                             log.debug(msg);
                             throw new NodeTypeConflictException(msg);
                         }
+                        // check ambiguous definitions
+                        if (def.definesNode() == existingDef.definesNode()) {
+                            if (!def.definesNode()) {
+                                // property definition
+                                PropDef pd = (PropDef) def;
+                                PropDef epd = (PropDef) existingDef;
+                                // compare type & multiValued flag
+                                if (pd.getRequiredType() == epd.getRequiredType()
+                                        && pd.isMultiple() == epd.isMultiple()) {
+                                    // conflict
+                                    String msg = "The property definition for '"
+                                            + name + "' in node type '"
+                                            + def.getDeclaringNodeType()
+                                            + "' conflicts with node type '"
+                                            + existingDef.getDeclaringNodeType()
+                                            + "': ambiguous property definition";
+                                    log.debug(msg);
+                                    throw new NodeTypeConflictException(msg);
+                                }
+                            } else {
+                                // child node definition
+                                // conflict
+                                String msg = "The child node definition for '"
+                                        + name + "' in node type '"
+                                        + def.getDeclaringNodeType()
+                                        + "' conflicts with node type '"
+                                        + existingDef.getDeclaringNodeType()
+                                        + "': ambiguous child node definition";
+                                log.debug(msg);
+                                throw new NodeTypeConflictException(msg);
+                            }
+                        }
                     }
                 }
             } else {
@@ -771,14 +806,22 @@
                         if (pd.getRequiredType() == epd.getRequiredType()
                                 && pd.isMultiple() == epd.isMultiple()) {
                             // conflict
-                            String msg = "A property definition in node type '" + def.getDeclaringNodeType() + "' conflicts with node type '" + existing.getDeclaringNodeType() + "': ambiguos residual property definition";
+                            String msg = "A property definition in node type '"
+                                    + def.getDeclaringNodeType()
+                                    + "' conflicts with node type '"
+                                    + existing.getDeclaringNodeType()
+                                    + "': ambiguous residual property definition";
                             log.debug(msg);
                             throw new NodeTypeConflictException(msg);
                         }
                     } else {
                         // child node definition
                         // conflict
-                        String msg = "A child node definition in node type '" + def.getDeclaringNodeType() + "' conflicts with node type '" + existing.getDeclaringNodeType() + "': ambiguos residual child node definition";
+                        String msg = "A child node definition in node type '"
+                                + def.getDeclaringNodeType()
+                                + "' conflicts with node type '"
+                                + existing.getDeclaringNodeType()
+                                + "': ambiguous residual child node definition";
                         log.debug(msg);
                         throw new NodeTypeConflictException(msg);
                     }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.java Wed Mar  9 10:36:14 2005
@@ -17,7 +17,12 @@
 package org.apache.jackrabbit.core.nodetype;
 
 import javax.jcr.PropertyType;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * A <code>NodeTypeDefDiff</code> represents the result of the comparison of
@@ -222,7 +227,6 @@
     }
 
     /**
-     *
      * @return
      */
     private int buildPropDefDiffs() {
@@ -280,7 +284,6 @@
     }
 
     /**
-     *
      * @return
      */
     private int buildChildNodeDefDiffs() {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefStore.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefStore.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefStore.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDefStore.java Wed Mar  9 10:36:14 2005
@@ -16,7 +16,13 @@
  */
 package org.apache.jackrabbit.core.nodetype;
 
-import org.apache.jackrabbit.core.*;
+import org.apache.jackrabbit.core.BaseException;
+import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.NamespaceRegistryImpl;
+import org.apache.jackrabbit.core.NamespaceResolver;
+import org.apache.jackrabbit.core.NoPrefixDeclaredException;
+import org.apache.jackrabbit.core.QName;
 import org.apache.log4j.Logger;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -35,7 +41,12 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * <code>NodeTypeDefStore</code> ...

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java Wed Mar  9 10:36:14 2005
@@ -35,7 +35,17 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PrintStream;
-import java.util.*;
+import java.util.AbstractCollection;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import java.util.TreeSet;
 
 /**
  * A <code>NodeTypeRegistry</code> ...

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java Wed Mar  9 10:36:14 2005
@@ -16,7 +16,15 @@
  */
 package org.apache.jackrabbit.core.nodetype;
 
-import org.apache.jackrabbit.core.*;
+import org.apache.jackrabbit.core.BLOBFileValue;
+import org.apache.jackrabbit.core.IllegalNameException;
+import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.MalformedPathException;
+import org.apache.jackrabbit.core.NamespaceResolver;
+import org.apache.jackrabbit.core.NoPrefixDeclaredException;
+import org.apache.jackrabbit.core.Path;
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.core.UnknownPrefixException;
 import org.apache.log4j.Logger;
 
 import javax.jcr.DateValue;

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/LuceneQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/LuceneQueryBuilder.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/LuceneQueryBuilder.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/LuceneQueryBuilder.java Wed Mar  9 10:36:14 2005
@@ -16,8 +16,28 @@
  */
 package org.apache.jackrabbit.core.search.lucene;
 
-import org.apache.jackrabbit.core.*;
-import org.apache.jackrabbit.core.search.*;
+import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.IllegalNameException;
+import org.apache.jackrabbit.core.MalformedPathException;
+import org.apache.jackrabbit.core.NoPrefixDeclaredException;
+import org.apache.jackrabbit.core.Path;
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.UnknownPrefixException;
+import org.apache.jackrabbit.core.search.AndQueryNode;
+import org.apache.jackrabbit.core.search.ExactQueryNode;
+import org.apache.jackrabbit.core.search.LocationStepQueryNode;
+import org.apache.jackrabbit.core.search.NodeTypeQueryNode;
+import org.apache.jackrabbit.core.search.NotQueryNode;
+import org.apache.jackrabbit.core.search.OrQueryNode;
+import org.apache.jackrabbit.core.search.OrderQueryNode;
+import org.apache.jackrabbit.core.search.PathQueryNode;
+import org.apache.jackrabbit.core.search.PropertyTypeRegistry;
+import org.apache.jackrabbit.core.search.QueryConstants;
+import org.apache.jackrabbit.core.search.QueryNodeVisitor;
+import org.apache.jackrabbit.core.search.QueryRootNode;
+import org.apache.jackrabbit.core.search.RelationQueryNode;
+import org.apache.jackrabbit.core.search.TextsearchQueryNode;
 import org.apache.log4j.Logger;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.index.Term;
@@ -28,18 +48,18 @@
 import org.apache.lucene.search.TermQuery;
 
 import javax.jcr.NamespaceException;
-import javax.jcr.RepositoryException;
 import javax.jcr.PropertyType;
-import javax.jcr.util.ISO8601;
+import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeIterator;
 import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.query.InvalidQueryException;
+import javax.jcr.util.ISO8601;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Calendar;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Calendar;
 
 /**
  * Implements a query builder that takes an abstract query tree and creates
@@ -78,10 +98,10 @@
      * The analyzer instance to use for contains function query parsing
      */
     private Analyzer analyzer;
-    
+
     /**
      * The property type registry.
-     */ 
+     */
     private PropertyTypeRegistry propRegistry;
 
     /**
@@ -578,10 +598,11 @@
      * trying to find out the {@link javax.jcr.PropertyType}s.
      * If no property type is found looking up node type information, this
      * method will guess the property type.
+     *
      * @param propertyName the name of the property in the relation.
-     * @param literal the String literal in the relation.
+     * @param literal      the String literal in the relation.
      * @return the String values to use as term for the query.
-     */ 
+     */
     private String[] getStringValues(QName propertyName, String literal) {
         PropertyTypeRegistry.TypeMapping[] types = propRegistry.getPropertyTypes(propertyName);
         List values = new ArrayList();

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/QueryFormat.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/QueryFormat.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/QueryFormat.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/QueryFormat.java Wed Mar  9 10:36:14 2005
@@ -20,7 +20,20 @@
 import org.apache.jackrabbit.core.NamespaceResolver;
 import org.apache.jackrabbit.core.NoPrefixDeclaredException;
 import org.apache.jackrabbit.core.QName;
-import org.apache.jackrabbit.core.search.*;
+import org.apache.jackrabbit.core.search.AndQueryNode;
+import org.apache.jackrabbit.core.search.ExactQueryNode;
+import org.apache.jackrabbit.core.search.LocationStepQueryNode;
+import org.apache.jackrabbit.core.search.NodeTypeQueryNode;
+import org.apache.jackrabbit.core.search.NotQueryNode;
+import org.apache.jackrabbit.core.search.OrQueryNode;
+import org.apache.jackrabbit.core.search.OrderQueryNode;
+import org.apache.jackrabbit.core.search.PathQueryNode;
+import org.apache.jackrabbit.core.search.QueryConstants;
+import org.apache.jackrabbit.core.search.QueryNode;
+import org.apache.jackrabbit.core.search.QueryNodeVisitor;
+import org.apache.jackrabbit.core.search.QueryRootNode;
+import org.apache.jackrabbit.core.search.RelationQueryNode;
+import org.apache.jackrabbit.core.search.TextsearchQueryNode;
 import org.apache.jackrabbit.core.util.ISO9075;
 
 import javax.jcr.query.InvalidQueryException;

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/XPathQueryBuilder.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/XPathQueryBuilder.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/xpath/XPathQueryBuilder.java Wed Mar  9 10:36:14 2005
@@ -16,8 +16,26 @@
  */
 package org.apache.jackrabbit.core.search.xpath;
 
-import org.apache.jackrabbit.core.*;
-import org.apache.jackrabbit.core.search.*;
+import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.IllegalNameException;
+import org.apache.jackrabbit.core.NamespaceRegistryImpl;
+import org.apache.jackrabbit.core.NamespaceResolver;
+import org.apache.jackrabbit.core.NoPrefixDeclaredException;
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.core.SearchManager;
+import org.apache.jackrabbit.core.UnknownPrefixException;
+import org.apache.jackrabbit.core.search.AndQueryNode;
+import org.apache.jackrabbit.core.search.LocationStepQueryNode;
+import org.apache.jackrabbit.core.search.NAryQueryNode;
+import org.apache.jackrabbit.core.search.NodeTypeQueryNode;
+import org.apache.jackrabbit.core.search.NotQueryNode;
+import org.apache.jackrabbit.core.search.OrQueryNode;
+import org.apache.jackrabbit.core.search.OrderQueryNode;
+import org.apache.jackrabbit.core.search.PathQueryNode;
+import org.apache.jackrabbit.core.search.QueryNode;
+import org.apache.jackrabbit.core.search.QueryRootNode;
+import org.apache.jackrabbit.core.search.RelationQueryNode;
+import org.apache.jackrabbit.core.search.TextsearchQueryNode;
 import org.apache.jackrabbit.core.util.ISO9075;
 
 import javax.jcr.query.InvalidQueryException;
@@ -141,7 +159,7 @@
      * Creates a new <code>XPathQueryBuilder</code> instance.
      *
      * @param statement the XPath statement.
-     * @param resolver the namespace resolver to use.
+     * @param resolver  the namespace resolver to use.
      * @throws InvalidQueryException if the XPath statement is malformed.
      */
     private XPathQueryBuilder(String statement, NamespaceResolver resolver)
@@ -176,7 +194,7 @@
      * Creates a <code>QueryNode</code> tree from a XPath statement.
      *
      * @param statement the XPath statement.
-     * @param resolver the namespace resolver to use.
+     * @param resolver  the namespace resolver to use.
      * @return the <code>QueryNode</code> tree for the XPath statement.
      * @throws InvalidQueryException if the XPath statement is malformed.
      */
@@ -190,11 +208,11 @@
     /**
      * Creates a String representation of the query node tree in XPath syntax.
      *
-     * @param root the root of the query node tree.
+     * @param root     the root of the query node tree.
      * @param resolver to resolve QNames.
      * @return a String representation of the query node tree.
      * @throws InvalidQueryException if the query node tree cannot be converted
-     *   into a String representation due to restrictions in XPath.
+     *                               into a String representation due to restrictions in XPath.
      */
     public static String toString(QueryRootNode root, NamespaceResolver resolver)
             throws InvalidQueryException {
@@ -217,9 +235,9 @@
      *
      * @param node the current node as created by the XPath parser.
      * @param data the current <code>QueryNode</code> created by this
-     *  <code>XPathVisitor</code>.
+     *             <code>XPathVisitor</code>.
      * @return the current <code>QueryNode</code>. Can be different from
-     *  <code>data</code>.
+     *         <code>data</code>.
      */
     public Object visit(SimpleNode node, Object data) {
         switch (node.getId()) {
@@ -302,7 +320,7 @@
                     if (node.getId() == JJTINTEGERLITERAL) {
                         int index = Integer.parseInt(node.getValue());
                         ((LocationStepQueryNode) data).setIndex(index);
-                } else {
+                    } else {
                         exceptions.add(new InvalidQueryException("LocationStep only allows integer literal as position index"));
                     }
                 } else {
@@ -319,7 +337,7 @@
                 break;
             case JJTORDERMODIFIER:
                 if (node.jjtGetNumChildren() > 0
-                        && ((SimpleNode) node.jjtGetChild(0)) .getId() == JJTDESCENDING) {
+                        && ((SimpleNode) node.jjtGetChild(0)).getId() == JJTDESCENDING) {
                     OrderQueryNode.OrderSpec[] specs = ((OrderQueryNode) data).getOrderSpecs();
                     specs[specs.length - 1].setAscending(false);
                 }
@@ -337,7 +355,7 @@
      * Creates a <code>LocationStepQueryNode</code> at the current position
      * in parent.
      *
-     * @param node the current node in the xpath syntax tree.
+     * @param node   the current node in the xpath syntax tree.
      * @param parent the parent <code>PathQueryNode</code>.
      * @return the created <code>LocationStepQueryNode</code>.
      */
@@ -365,9 +383,9 @@
      * Creates a name test either for a <code>LocationStepQueryNode</code> or
      * for a <code>RelationQueryNode</code>.
      *
-     * @param node the current node in the xpath syntax tree.
+     * @param node      the current node in the xpath syntax tree.
      * @param queryNode either a <code>LocationStepQueryNode</code> or a
-     *   <code>RelationQueryNode</code>.
+     *                  <code>RelationQueryNode</code>.
      */
     private void createNameTest(SimpleNode node, QueryNode queryNode) {
         if (node.jjtGetNumChildren() > 0) {
@@ -409,7 +427,7 @@
      * Creates a new {@link org.apache.jackrabbit.core.search.RelationQueryNode}
      * with <code>queryNode</code> as its parent node.
      *
-     * @param node a comparison expression node.
+     * @param node      a comparison expression node.
      * @param queryNode the current <code>QueryNode</code>.
      */
     private void createExpression(SimpleNode node, NAryQueryNode queryNode) {
@@ -482,8 +500,8 @@
     /**
      * Assigns a value to the <code>queryNode</code>.
      *
-     * @param node must be of type string, decimal, double or integer; otherwise
-     *   an InvalidQueryException is added to {@link #exceptions}.
+     * @param node      must be of type string, decimal, double or integer; otherwise
+     *                  an InvalidQueryException is added to {@link #exceptions}.
      * @param queryNode current node in the query tree.
      */
     private void assignValue(SimpleNode node, RelationQueryNode queryNode) {
@@ -509,7 +527,7 @@
     /**
      * Creates a function based on <code>node</code>.
      *
-     * @param node the function node from the xpath tree.
+     * @param node      the function node from the xpath tree.
      * @param queryNode the current query node.
      * @return
      */

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferences.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferences.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferences.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferences.java Wed Mar  9 10:36:14 2005
@@ -20,7 +20,9 @@
 import org.apache.log4j.Logger;
 
 import java.io.Serializable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * <code>NodeReferences</code> represents the references (i.e. properties of
@@ -59,11 +61,12 @@
      * @param targetId
      */
     public NodeReferences(NodeReferencesId targetId) {
-        this.targetId  = targetId;
+        this.targetId = targetId;
     }
 
     /**
      * Return the target id of this node references object.
+     *
      * @return target id
      */
     public NodeReferencesId getTargetId() {
@@ -72,6 +75,7 @@
 
     /**
      * Return the UUID of the target id
+     *
      * @return UUID of the target id
      */
     public String getUUID() {
@@ -80,8 +84,9 @@
 
     /**
      * Return a flag indicating whether this object holds any references
+     *
      * @return <code>true</code> if this object holds references,
-     * <code>false</code> otherwise
+     *         <code>false</code> otherwise
      */
     public boolean hasReferences() {
         return !references.isEmpty();

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PropertyState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PropertyState.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PropertyState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PropertyState.java Wed Mar  9 10:36:14 2005
@@ -25,7 +25,13 @@
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.StringWriter;
 
 /**
  * <code>PropertyState</code> represents the state of a <code>Property</code>.
@@ -46,7 +52,7 @@
      *
      * @param overlayedState the backing property state being overlayed
      * @param initialStatus  the initial status of the property state object
-     * @param isTransient   flag indicating whether this state is transient or not
+     * @param isTransient    flag indicating whether this state is transient or not
      */
     public PropertyState(PropertyState overlayedState, int initialStatus,
                          boolean isTransient) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java Wed Mar  9 10:36:14 2005
@@ -16,20 +16,47 @@
  */
 package org.apache.jackrabbit.core.state.obj;
 
-import org.apache.jackrabbit.core.*;
-import org.apache.jackrabbit.core.fs.*;
+import org.apache.jackrabbit.core.BLOBFileValue;
+import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.PropertyId;
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.core.fs.BasedFileSystem;
 import org.apache.jackrabbit.core.fs.FileSystem;
+import org.apache.jackrabbit.core.fs.FileSystemException;
+import org.apache.jackrabbit.core.fs.FileSystemPathUtil;
+import org.apache.jackrabbit.core.fs.FileSystemResource;
 import org.apache.jackrabbit.core.fs.local.LocalFileSystem;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.core.nodetype.PropDefId;
-import org.apache.jackrabbit.core.state.*;
+import org.apache.jackrabbit.core.state.AbstractPersistenceManager;
+import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.NoSuchItemStateException;
+import org.apache.jackrabbit.core.state.NodeReferences;
+import org.apache.jackrabbit.core.state.NodeReferencesId;
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.core.state.PMContext;
+import org.apache.jackrabbit.core.state.PersistenceManager;
+import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.log4j.Logger;
 
 import javax.jcr.PropertyType;
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
 
 /**
  * <code>ObjectPersistenceManager</code> is a <code>FileSystem</code>-based
@@ -42,7 +69,9 @@
 
     private static Logger log = Logger.getLogger(ObjectPersistenceManager.class);
 
-    /** encoding used for serializing String values */
+    /**
+     * encoding used for serializing String values
+     */
     private static final String ENCODING = "UTF-8";
 
     /**
@@ -533,8 +562,7 @@
             throw new IllegalStateException("not initialized");
         }
 
-        String propFilePath = buildPropFilePath(
-                id.getParentUUID(), id.getName());
+        String propFilePath = buildPropFilePath(id.getParentUUID(), id.getName());
 
         try {
             if (!itemStateFS.isFile(propFilePath)) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Base64.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Base64.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Base64.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Base64.java Wed Mar  9 10:36:14 2005
@@ -16,7 +16,13 @@
  */
 package org.apache.jackrabbit.core.util;
 
-import java.io.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
 
 /**
  * <code>Base64</code> provides Base64 encoding/decoding of strings and streams.

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java Wed Mar  9 10:36:14 2005
@@ -21,7 +21,19 @@
 import org.apache.jackrabbit.core.Path;
 import org.apache.jackrabbit.core.QName;
 
-import javax.jcr.*;
+import javax.jcr.BinaryValue;
+import javax.jcr.BooleanValue;
+import javax.jcr.DateValue;
+import javax.jcr.DoubleValue;
+import javax.jcr.LongValue;
+import javax.jcr.NameValue;
+import javax.jcr.PathValue;
+import javax.jcr.PropertyType;
+import javax.jcr.ReferenceValue;
+import javax.jcr.RepositoryException;
+import javax.jcr.StringValue;
+import javax.jcr.Value;
+import javax.jcr.ValueFormatException;
 
 /**
  * The <code>ValueHelper</code> class provides several <code>Value</code>

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java Wed Mar  9 10:36:14 2005
@@ -16,22 +16,27 @@
  */
 package org.apache.jackrabbit.core.version;
 
-import org.apache.jackrabbit.core.*;
+import org.apache.jackrabbit.core.IllegalNameException;
+import org.apache.jackrabbit.core.ItemLifeCycleListener;
+import org.apache.jackrabbit.core.ItemManager;
+import org.apache.jackrabbit.core.NoPrefixDeclaredException;
+import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.NodeImpl;
+import org.apache.jackrabbit.core.PropertyImpl;
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.UnknownPrefixException;
 import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.core.state.NodeReferencesId;
-import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.state.ItemStateException;
 
 import javax.jcr.Item;
+import javax.jcr.PropertyIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.PropertyIterator;
 import javax.jcr.nodetype.NodeDef;
 import javax.jcr.version.Version;
 import javax.jcr.version.VersionException;
 import javax.jcr.version.VersionHistory;
 import javax.jcr.version.VersionIterator;
-import java.util.List;
 
 /**
  * This Class implements a version history that extends a node.
@@ -152,7 +157,7 @@
         try {
             QName[] labels = history.getVersionLabels();
             String[] ret = new String[labels.length];
-            for (int i=0; i<labels.length; i++) {
+            for (int i = 0; i < labels.length; i++) {
                 ret[i] = labels[i].toJCRName(session.getNamespaceResolver());
             }
             return ret;
@@ -170,7 +175,7 @@
         try {
             QName[] labels = ((VersionImpl) version).getInternalVersion().getLabels();
             String[] ret = new String[labels.length];
-            for (int i=0; i<labels.length; i++) {
+            for (int i = 0; i < labels.length; i++) {
                 ret[i] = labels[i].toJCRName(session.getNamespaceResolver());
             }
             return ret;
@@ -185,7 +190,7 @@
     public boolean hasVersionLabel(String label) {
         try {
             QName qLabel = QName.fromJCRName(label, session.getNamespaceResolver());
-            return history.getVersionByLabel(qLabel)!=null;
+            return history.getVersionByLabel(qLabel) != null;
         } catch (IllegalNameException e) {
             throw new IllegalArgumentException("Unable to resolve label: " + e);
         } catch (UnknownPrefixException e) {
@@ -216,13 +221,13 @@
             throws UnsupportedRepositoryOperationException, VersionException,
             RepositoryException {
 
-	// check if any references exist on this version
-	VersionImpl v = (VersionImpl) getVersion(versionName);
-	PropertyIterator iter = v.getReferences();
-	if (iter.hasNext()) {
-	    throw new VersionException("Unable to remove version. At least once referenced: " + ((PropertyImpl) iter.nextProperty()).safeGetJCRPath());
-	}
-	history.removeVersion(v.getQName());
+        // check if any references exist on this version
+        VersionImpl v = (VersionImpl) getVersion(versionName);
+        PropertyIterator iter = v.getReferences();
+        if (iter.hasNext()) {
+            throw new VersionException("Unable to remove version. At least once referenced: " + ((PropertyImpl) iter.nextProperty()).safeGetJCRPath());
+        }
+        history.removeVersion(v.getQName());
     }
 
     /**
@@ -247,6 +252,7 @@
 
     /**
      * Returns the UUID of the node that was versioned.
+     *
      * @return
      */
     public String getVersionableUUID() throws RepositoryException {
@@ -255,6 +261,7 @@
 
     /**
      * Checks if the given version belongs to this history
+     *
      * @param version
      * @throws VersionException
      * @throws RepositoryException
@@ -268,7 +275,7 @@
 
     /**
      * {@inheritDoc}
-     *
+     * <p/>
      * In addition to the normal behaviour, this method also filters out the
      * references that do not exist in this workspace.
      */

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java Wed Mar  9 10:36:14 2005
@@ -17,9 +17,27 @@
 package org.apache.jackrabbit.core.version;
 
 import org.apache.commons.collections.ReferenceMap;
-import org.apache.jackrabbit.core.*;
-import org.apache.jackrabbit.core.nodetype.*;
-import org.apache.jackrabbit.core.state.*;
+import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.PropertyId;
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.core.nodetype.ChildNodeDef;
+import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
+import org.apache.jackrabbit.core.nodetype.NodeDefId;
+import org.apache.jackrabbit.core.nodetype.NodeTypeConflictException;
+import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
+import org.apache.jackrabbit.core.nodetype.PropDef;
+import org.apache.jackrabbit.core.nodetype.PropDefId;
+import org.apache.jackrabbit.core.state.ItemState;
+import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.ItemStateManager;
+import org.apache.jackrabbit.core.state.NoSuchItemStateException;
+import org.apache.jackrabbit.core.state.NodeReferences;
+import org.apache.jackrabbit.core.state.NodeReferencesId;
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.util.uuid.UUID;
 import org.apache.jackrabbit.core.virtual.VirtualItemStateProvider;
 import org.apache.jackrabbit.core.virtual.VirtualNodeState;
@@ -75,10 +93,14 @@
      */
     private NodeDefId NDEF_VERSION_LABELS;
 
-    /** the parent id */
+    /**
+     * the parent id
+     */
     private final String parentId;
 
-    /** the root node id */
+    /**
+     * the root node id
+     */
     private final String rootNodeId;
 
     /**
@@ -104,6 +126,7 @@
 
     /**
      * Creates a new root node state
+     *
      * @throws RepositoryException
      */
     private void createRootNodeState() throws RepositoryException {
@@ -151,12 +174,12 @@
                 if (vi instanceof InternalVersion) {
                     InternalVersion v = (InternalVersion) vi;
                     InternalVersion[] suc = v.getSuccessors();
-                    for (int i=0; i<suc.length; i++) {
+                    for (int i = 0; i < suc.length; i++) {
                         InternalVersion s = suc[i];
                         ref.addReference(new PropertyId(s.getId(), JCR_PREDECESSORS));
                     }
                     InternalVersion[] pred = v.getPredecessors();
-                    for (int i=0; i<pred.length; i++) {
+                    for (int i = 0; i < pred.length; i++) {
                         InternalVersion p = pred[i];
                         ref.addReference(new PropertyId(p.getId(), JCR_SUCCESSORS));
                     }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java Wed Mar  9 10:36:14 2005
@@ -16,10 +16,11 @@
  */
 package org.apache.jackrabbit.core.version;
 
-import org.apache.jackrabbit.core.*;
+import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
-import org.apache.jackrabbit.core.state.ItemStateManager;
 import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.ItemStateManager;
 import org.apache.jackrabbit.core.virtual.VirtualItemStateProvider;
 import org.apache.log4j.Logger;
 
@@ -104,6 +105,7 @@
      * Close this version manager. After having closed a persistence
      * manager, further operations on this object are treated as illegal
      * and throw
+     *
      * @throws Exception if an error occurs
      */
     public void close() throws Exception {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java Wed Mar  9 10:36:14 2005
@@ -16,7 +16,11 @@
  */
 package org.apache.jackrabbit.core.version.persistence;
 
-import org.apache.jackrabbit.core.*;
+import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.NodeImpl;
+import org.apache.jackrabbit.core.PropertyImpl;
+import org.apache.jackrabbit.core.QName;
 import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NodeState;

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java?view=diff&r1=156665&r2=156666
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java Wed Mar  9 10:36:14 2005
@@ -17,9 +17,22 @@
 package org.apache.jackrabbit.core.version.persistence;
 
 import org.apache.commons.collections.ReferenceMap;
-import org.apache.jackrabbit.core.*;
+import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.NodeImpl;
+import org.apache.jackrabbit.core.PropertyId;
+import org.apache.jackrabbit.core.QName;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
-import org.apache.jackrabbit.core.state.*;
+import org.apache.jackrabbit.core.state.ChangeLog;
+import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.LocalItemStateManager;
+import org.apache.jackrabbit.core.state.NodeReferences;
+import org.apache.jackrabbit.core.state.NodeReferencesId;
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.core.state.PersistenceManager;
+import org.apache.jackrabbit.core.state.PropertyState;
+import org.apache.jackrabbit.core.state.SharedItemStateManager;
+import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
 import org.apache.jackrabbit.core.util.uuid.UUID;
 import org.apache.jackrabbit.core.version.InternalVersion;
 import org.apache.jackrabbit.core.version.InternalVersionHistory;
@@ -29,7 +42,11 @@
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
 /**
  * This Class implements the persistent part of the versioning. the



Mime
View raw message