jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r997303 - in /jackrabbit/trunk: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ jac...
Date Wed, 15 Sep 2010 12:17:46 GMT
Author: jukka
Date: Wed Sep 15 12:17:44 2010
New Revision: 997303

URL: http://svn.apache.org/viewvc?rev=997303&view=rev
Log:
JCR-2744: Avoid element arrays in PathImpl

Avoid using Path.getNameElement() where possible

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AggregateRuleImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/identifier/AbstractIdFactory.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/AbstractPath.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathFactoryTest.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathTest.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathOrderByTest.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ItemInfoImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/test/java/org/apache/jackrabbit/spi2davex/ExtensionTest.java
    jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventFactory.java
    jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java Wed Sep 15 12:17:44 2010
@@ -217,10 +217,9 @@ public class BatchedItemOperations exten
         // 1. check paths & retrieve state
         NodeState srcState = getNodeState(srcPath);
 
-        Path.Element destName = destPath.getNameElement();
         Path destParentPath = destPath.getAncestor(1);
         NodeState destParentState = getNodeState(destParentPath);
-        int ind = destName.getIndex();
+        int ind = destPath.getIndex();
         if (ind > 0) {
             // subscript in name element
             String msg =
@@ -230,7 +229,7 @@ public class BatchedItemOperations exten
             throw new RepositoryException(msg);
         }
 
-        return clone(srcState, destParentState, destName.getName());
+        return clone(srcState, destParentState, destPath.getName());
     }
 
     /**
@@ -381,10 +380,9 @@ public class BatchedItemOperations exten
 
         NodeState srcState = getNodeState(srcStateMgr, srcHierMgr, srcPath);
 
-        Path.Element destName = destPath.getNameElement();
         Path destParentPath = destPath.getAncestor(1);
         NodeState destParentState = getNodeState(destParentPath);
-        int ind = destName.getIndex();
+        int ind = destPath.getIndex();
         if (ind > 0) {
             // subscript in name element
             String msg =
@@ -400,7 +398,7 @@ public class BatchedItemOperations exten
         // precautionary measure in order to isolate it from concurrent
         // underlying changes while checking preconditions
         stateMgr.store(destParentState);
-        checkAddNode(destParentState, destName.getName(),
+        checkAddNode(destParentState, destPath.getName(),
                 srcState.getNodeTypeName(), CHECK_ACCESS | CHECK_LOCK
                 | CHECK_CHECKED_OUT | CHECK_CONSTRAINTS | CHECK_HOLD | CHECK_RETENTION);
         // check read access right on source node using source access manager
@@ -425,7 +423,7 @@ public class BatchedItemOperations exten
                 destParentState.getNodeId(), flag, refTracker);
 
         // add to new parent
-        destParentState.addChildNodeEntry(destName.getName(), newState.getNodeId());
+        destParentState.addChildNodeEntry(destPath.getName(), newState.getNodeId());
 
         // adjust references that refer to uuid's which have been mapped to
         // newly generated uuid's on copy/clone
@@ -509,16 +507,14 @@ public class BatchedItemOperations exten
             throw new RepositoryException(msg, mpe);
         }
 
-        Path.Element srcName = srcPath.getNameElement();
         Path srcParentPath = srcPath.getAncestor(1);
         NodeState target = getNodeState(srcPath);
         NodeState srcParent = getNodeState(srcParentPath);
 
-        Path.Element destName = destPath.getNameElement();
         Path destParentPath = destPath.getAncestor(1);
         NodeState destParent = getNodeState(destParentPath);
 
-        int ind = destName.getIndex();
+        int ind = destPath.getIndex();
         if (ind > 0) {
             // subscript in name element
             String msg =
@@ -542,22 +538,22 @@ public class BatchedItemOperations exten
         checkRemoveNode(target, srcParent.getNodeId(),
                 CHECK_ACCESS | CHECK_LOCK | CHECK_CHECKED_OUT | CHECK_CONSTRAINTS
                 | CHECK_HOLD | CHECK_RETENTION);
-        checkAddNode(destParent, destName.getName(),
+        checkAddNode(destParent, destPath.getName(),
                 target.getNodeTypeName(), CHECK_ACCESS | CHECK_LOCK
                 | CHECK_CHECKED_OUT | CHECK_CONSTRAINTS | CHECK_HOLD | CHECK_RETENTION);
 
         // 3. do move operation (modify and store affected states)
         boolean renameOnly = srcParent.getNodeId().equals(destParent.getNodeId());
 
-        int srcNameIndex = srcName.getIndex();
+        int srcNameIndex = srcPath.getIndex();
         if (srcNameIndex == 0) {
             srcNameIndex = 1;
         }
 
         if (renameOnly) {
             // change child node entry
-            destParent.renameChildNodeEntry(srcName.getName(), srcNameIndex,
-                    destName.getName());
+            destParent.renameChildNodeEntry(srcPath.getName(), srcNameIndex,
+                    destPath.getName());
         } else {
             // check shareable case
             if (target.isShareable()) {
@@ -574,7 +570,7 @@ public class BatchedItemOperations exten
                 // 2. re-parent target node
                 target.setParentId(destParent.getNodeId());
                 // 3. add child node entry to new parent
-                destParent.addChildNodeEntry(destName.getName(), target.getNodeId());
+                destParent.addChildNodeEntry(destPath.getName(), target.getNodeId());
             }
         }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java Wed Sep 15 12:17:44 2010
@@ -717,8 +717,7 @@ public class CachingHierarchyManager ext
             return;
         }
         PathMap.Element<LRUEntry> element =
-            parent.getDescendant(PathFactoryImpl.getInstance().create(
-                new Path.Element[] { path.getNameElement() }), true);
+            parent.getDescendant(path.getLastElement(), true);
         if (element != null) {
             // with SNS, this might evict a child that is NOT the one
             // having <code>id</code>, check first whether item has

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java Wed Sep 15 12:17:44 2010
@@ -78,8 +78,7 @@ class ItemRemoveOperation implements Ses
         if (item.isNode()) {
             parentNode.removeChildNode((NodeId) item.getId());
         } else {
-            Path.Element thisName = item.getPrimaryPath().getNameElement();
-            parentNode.removeChildProperty(thisName.getName());
+            parentNode.removeChildProperty(item.getPrimaryPath().getName());
         }
 
         return this;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java Wed Sep 15 12:17:44 2010
@@ -249,35 +249,26 @@ public class NodeImpl extends ItemImpl i
      *                             relative path
      */
     private NodeId getNodeId(Path p) throws RepositoryException {
-        if (p.getLength() == 1) {
-            Path.Element pe = p.getNameElement();
-            if (pe.denotesName()) {
-                // check if node entry exists
-                NodeState thisState = data.getNodeState();
-                int index = pe.getIndex();
-                if (index == 0) {
-                    index = 1;
-                }
-                ChildNodeEntry cne =
-                        thisState.getChildNodeEntry(pe.getName(), index);
-                if (cne != null) {
-                    return cne.getId();
-                } else {
-                    // there's no child node with that name
-                    return null;
-                }
+        if (p.getLength() == 1 && p.denotesName()) {
+            // check if node entry exists
+            ChildNodeEntry cne = data.getNodeState().getChildNodeEntry(
+                    p.getName(), p.getNormalizedIndex());
+            if (cne != null) {
+                return cne.getId();
+            } else {
+                return null; // there's no child node with that name
             }
+        } else {
+            // build and resolve absolute path
+            try {
+                p = PathFactoryImpl.getInstance().create(
+                        getPrimaryPath(), p, true);
+            } catch (RepositoryException re) {
+                // failed to build canonical path
+                return null;
+            }
+            return sessionContext.getHierarchyManager().resolveNodePath(p);
         }
-        /**
-         * build and resolve absolute path
-         */
-        try {
-            p = PathFactoryImpl.getInstance().create(getPrimaryPath(), p, true);
-        } catch (RepositoryException re) {
-            // failed to build canonical path
-            return null;
-        }
-        return sessionContext.getHierarchyManager().resolveNodePath(p);
     }
 
     /**
@@ -293,30 +284,26 @@ public class NodeImpl extends ItemImpl i
      *                             relative path
      */
     private PropertyId getPropertyId(Path p) throws RepositoryException {
-        if (p.getLength() == 1) {
-            Path.Element pe = p.getNameElement();
-            if (pe.denotesName()) {
-                // check if property entry exists
-                NodeState thisState = data.getNodeState();
-                if (pe.getIndex() == Path.INDEX_UNDEFINED
-                        && thisState.hasPropertyName(pe.getName())) {
-                    return new PropertyId(thisState.getNodeId(), pe.getName());
-                } else {
-                    // there's no property with that name
-                    return null;
-                }
+        if (p.getLength() == 1 && p.denotesName()) {
+            // check if property entry exists
+            NodeState thisState = data.getNodeState();
+            if (p.getIndex() == Path.INDEX_UNDEFINED
+                    && thisState.hasPropertyName(p.getName())) {
+                return new PropertyId(thisState.getNodeId(), p.getName());
+            } else {
+                return null; // there's no property with that name
             }
+        } else {
+            // build and resolve absolute path
+            try {
+                p = PathFactoryImpl.getInstance().create(
+                        getPrimaryPath(), p, true);
+            } catch (RepositoryException re) {
+                // failed to build canonical path
+                return null;
+            }
+            return sessionContext.getHierarchyManager().resolvePropertyPath(p);
         }
-        /**
-         * build and resolve absolute path
-         */
-        try {
-            p = PathFactoryImpl.getInstance().create(getPrimaryPath(), p, true);
-        } catch (RepositoryException re) {
-            // failed to build canonical path
-            return null;
-        }
-        return sessionContext.getHierarchyManager().resolvePropertyPath(p);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java Wed Sep 15 12:17:44 2010
@@ -45,25 +45,19 @@ public class SessionMoveOperation implem
 
     private final Path srcPath;
 
-    private final Path.Element srcName;
-
     private final String destAbsPath;
 
     private final Path destPath;
 
-    private final Path.Element destName;
-
     public SessionMoveOperation(
             PathResolver resolver, String srcAbsPath, String destAbsPath)
             throws RepositoryException {
         this.srcAbsPath = srcAbsPath;
         this.srcPath = getAbsolutePath(resolver, srcAbsPath);
-        this.srcName = srcPath.getNameElement();
 
         this.destAbsPath = destAbsPath;
         this.destPath = getAbsolutePath(resolver, destAbsPath);
-        this.destName = destPath.getNameElement();
-        if (destName.getIndex() > 0) {
+        if (destPath.getIndex() != Path.INDEX_UNDEFINED) {
             // subscript in name element
             String msg = destAbsPath + ": invalid destination path (subscript in name element is not allowed)";
             log.debug(msg);
@@ -147,7 +141,7 @@ public class SessionMoveOperation implem
         NodeTypeImpl nt = (NodeTypeImpl) targetNode.getPrimaryNodeType();
         org.apache.jackrabbit.spi.commons.nodetype.NodeDefinitionImpl newTargetDef;
         try {
-            newTargetDef = destParentNode.getApplicableChildNodeDefinition(destName.getName(), nt.getQName());
+            newTargetDef = destParentNode.getApplicableChildNodeDefinition(destPath.getName(), nt.getQName());
         } catch (RepositoryException re) {
             String msg = destAbsPath + ": no definition found in parent node's node type for new node";
             log.debug(msg);
@@ -163,10 +157,7 @@ public class SessionMoveOperation implem
         }
 
         NodeId targetId = targetNode.getNodeId();
-        int index = srcName.getIndex();
-        if (index == 0) {
-            index = 1;
-        }
+        int index = srcPath.getNormalizedIndex();
 
         // check permissions
         AccessManager acMgr = context.getAccessManager();
@@ -181,7 +172,7 @@ public class SessionMoveOperation implem
             // change definition of target
             targetNode.onRedefine(newTargetDef.unwrap());
             // do rename
-            destParentNode.renameChildNode(targetId, destName.getName(), false);
+            destParentNode.renameChildNode(targetId, destPath.getName(), false);
         } else {
             // check shareable case
             if (targetNode.getNodeState().isShareable()) {
@@ -206,7 +197,7 @@ public class SessionMoveOperation implem
                 // 2. re-parent target node
                 targetState.setParentId(destParentNode.getNodeId());
                 // 3. add child node entry to new parent
-                destParentState.addChildNodeEntry(destName.getName(), targetId);
+                destParentState.addChildNodeEntry(destPath.getName(), targetId);
             }
         }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java Wed Sep 15 12:17:44 2010
@@ -305,7 +305,7 @@ public class VersionManagerImpl extends 
                     // parent has to exist
                     Path path = context.getQPath(absPath);
                     Path parentPath = path.getAncestor(1);
-                    Name name = path.getNameElement().getName();
+                    Name name = path.getName();
                     NodeImpl parent = context.getItemManager().getNode(parentPath);
 
                     NodeStateEx state = getNodeState(

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AggregateRuleImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AggregateRuleImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AggregateRuleImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AggregateRuleImpl.java Wed Sep 15 12:17:44 2010
@@ -436,7 +436,7 @@ class AggregateRuleImpl implements Aggre
         PropertyInclude(Path pattern)
                 throws RepositoryException {
             super(pattern.getAncestor(1), null);
-            this.propertyName = pattern.getNameElement().getName();
+            this.propertyName = pattern.getName();
         }
 
         /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java Wed Sep 15 12:17:44 2010
@@ -382,7 +382,7 @@ public class LuceneQueryBuilder implemen
                 fieldname = FieldNames.FULLTEXT;
             } else {
                 // final path element is a property name
-                Name propName = relPath.getNameElement().getName();
+                Name propName = relPath.getName();
                 StringBuffer tmp = new StringBuffer();
                 tmp.append(nsMappings.getPrefix(propName.getNamespaceURI()));
                 tmp.append(":").append(FieldNames.FULLTEXT_PREFIX);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java Wed Sep 15 12:17:44 2010
@@ -1049,7 +1049,7 @@ public class SearchIndex extends Abstrac
         List<SortField> sortFields = new ArrayList<SortField>();
         for (int i = 0; i < orderProps.length; i++) {
             if (orderProps[i].getLength() == 1
-                    && NameConstants.JCR_SCORE.equals(orderProps[i].getNameElement().getName())) {
+                    && NameConstants.JCR_SCORE.equals(orderProps[i].getName())) {
                 // order on jcr:score does not use the natural order as
                 // implemented in lucene. score ascending in lucene means that
                 // higher scores are first. JCR specs that lower score values

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java Wed Sep 15 12:17:44 2010
@@ -221,7 +221,7 @@ public class Join implements MultiColumn
                         outer = src1;
                         outerIdx = getIndex(outer, node.getSelector1QName());
                         Path selector2Path = node.getSelector2QPath();
-                        if (selector2Path == null || (selector2Path.getLength() == 1 && selector2Path.getNameElement().denotesCurrent())) {
+                        if (selector2Path == null || (selector2Path.getLength() == 1 && selector2Path.denotesCurrent())) {
                             c = new SameNodeJoin(src2, node.getSelector2QName(), reader);
                         } else {
                             c = new DescendantPathNodeJoin(src2, node.getSelector2QName(),
@@ -231,7 +231,7 @@ public class Join implements MultiColumn
                         outer = src2;
                         outerIdx = getIndex(outer, node.getSelector2QName());
                         Path selector2Path = node.getSelector2QPath();
-                        if (selector2Path == null || (selector2Path.getLength() == 1 && selector2Path.getNameElement().denotesCurrent())) {
+                        if (selector2Path == null || (selector2Path.getLength() == 1 && selector2Path.denotesCurrent())) {
                             c = new SameNodeJoin(src1, node.getSelector1QName(), reader);
                         } else {
                             c = new AncestorPathNodeJoin(src1, node.getSelector1QName(),

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java Wed Sep 15 12:17:44 2010
@@ -306,7 +306,7 @@ public class RetentionRegistryImpl imple
             try {
                 Path evPath = session.getQPath(ev.getPath());
                 Path nodePath = evPath.getAncestor(1);
-                Name propName = evPath.getNameElement().getName();
+                Name propName = evPath.getName();
 
                 if (RetentionManagerImpl.REP_HOLD.equals(propName)) {
                     // hold changes

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java Wed Sep 15 12:17:44 2010
@@ -99,7 +99,7 @@ class IndexNodeResolver extends NodeReso
     public NodeIterator findNodes(Path relPath, String value, int authorizableType, boolean exact, long maxSize) throws RepositoryException {
         Query query;
         if (relPath.getLength() == 1) {
-            Set<Name> names = Collections.singleton(relPath.getNameElement().getName());
+            Set<Name> names = Collections.singleton(relPath.getName());
             // search without nt-restriction in order not to limit the query to the
             // authorizable nodes and filter non-matching results later.
             query = buildQuery(value, names, null, exact, maxSize, getSearchRoot(authorizableType));
@@ -218,7 +218,7 @@ class IndexNodeResolver extends NodeReso
 
         if (value != null) {
             stmt.append("[");
-            Name prop = relPath.getNameElement().getName();
+            Name prop = relPath.getName();
             stmt.append((exact) ? "@" : "jcr:like(@");
             String pName = getNamePathResolver().getJCRName(prop);
             stmt.append(ISO9075.encode(pName));

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java Wed Sep 15 12:17:44 2010
@@ -478,7 +478,7 @@ public class UserManagerImpl extends Pro
                     default:
                         ntName = NT_REP_AUTHORIZABLE;
                 }
-                nodes = authResolver.findNodes(path.getNameElement().getName(), value, ntName, true);
+                nodes = authResolver.findNodes(path.getName(), value, ntName, true);
             } else {
                 // search below authorizable nodes but take some path constraints
                 // into account.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java Wed Sep 15 12:17:44 2010
@@ -67,9 +67,8 @@ public class AddNodeOperation implements
                     + " relative to " + node, e);
         }
 
-        // Get the last path element and check that it's a simple name
-        Path.Element last = path.getNameElement();
-        if (!last.denotesName() || last.getIndex() != 0) {
+        // Check that the last path element is a simple name
+        if (!path.denotesName() || path.getIndex() != Path.INDEX_UNDEFINED) {
             throw new RepositoryException(
                     "Invalid last path element for adding node "
                     + relPath + " relative to " + node);
@@ -109,7 +108,7 @@ public class AddNodeOperation implements
             }
         }
 
-        return parentNode.addNode(last.getName(), typeName, id);
+        return parentNode.addNode(path.getName(), typeName, id);
     }
 
 

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java Wed Sep 15 12:17:44 2010
@@ -156,7 +156,7 @@ public class NodeImpl extends ItemImpl i
         checkIsWritable();
         // build path object and retrieve parent node
         Path nodePath = getPath(relPath).getNormalizedPath();
-        if (nodePath.getNameElement().getIndex() != Path.INDEX_UNDEFINED) {
+        if (nodePath.getIndex() != Path.INDEX_UNDEFINED) {
             String msg = "Illegal subscript specified: " + relPath;
             log.debug(msg);
             throw new RepositoryException(msg);
@@ -180,7 +180,7 @@ public class NodeImpl extends ItemImpl i
         }
 
         // get names objects for node and nt
-        Name nodeName = nodePath.getNameElement().getName();
+        Name nodeName = nodePath.getName();
         Name ntName = (primaryNodeTypeName == null) ? null : getQName(primaryNodeTypeName);
 
         // create new node (including validation checks)
@@ -211,10 +211,13 @@ public class NodeImpl extends ItemImpl i
             throw new ItemNotFoundException("Node " + safeGetJCRPath() + " has no child node with name " + destChildRelPath);
         }
 
-        Path.Element srcName = getReorderPath(srcChildRelPath).getNameElement();
-        Path.Element beforeName = (destChildRelPath == null) ? null : getReorderPath(destChildRelPath).getNameElement();
+        Path srcPath = getReorderPath(srcChildRelPath);
+        Path beforePath = null;
+        if (destChildRelPath != null) {
+            beforePath = getReorderPath(destChildRelPath);
+        }
 
-        Operation op = ReorderNodes.create(getNodeState(), srcName, beforeName);
+        Operation op = ReorderNodes.create(getNodeState(), srcPath, beforePath);
         session.getSessionItemStateManager().execute(op);
     }
 
@@ -1719,7 +1722,7 @@ public class NodeImpl extends ItemImpl i
      */
     private Path getPath(Path relativePath) throws RepositoryException {
         // shortcut
-        if (relativePath.getLength() == 1 && relativePath.getNameElement() == session.getPathFactory().getCurrentElement()) {
+        if (relativePath.getLength() == 1 && relativePath.denotesCurrent()) {
             return getQPath();
         }
         return session.getPathFactory().create(getQPath(), relativePath, true);
@@ -1743,14 +1746,14 @@ public class NodeImpl extends ItemImpl i
             Path rp = session.getPathResolver().getQPath(relPath);
             // shortcut
             if (rp.getLength() == 1) {
-                Path.Element pe = rp.getNameElement();
-                if (pe.denotesCurrent()) {
+                if (rp.denotesCurrent()) {
                     targetEntry = getNodeEntry();
-                } else if (pe.denotesParent()) {
+                } else if (rp.denotesParent()) {
                     targetEntry = getNodeEntry().getParent();
                 } else {
                     // try to get child entry + force loading of not known yet
-                    targetEntry = getNodeEntry().getNodeEntry(pe.getName(), pe.getNormalizedIndex(), true);
+                    targetEntry = getNodeEntry().getNodeEntry(
+                            rp.getName(), rp.getNormalizedIndex(), true);
                 }
             } else {
                 // rp length > 1
@@ -1783,11 +1786,11 @@ public class NodeImpl extends ItemImpl i
         PropertyEntry targetEntry = null;
         try {
             Path rp = session.getPathResolver().getQPath(relPath);
-            if (rp.getLength() == 1 && rp.getNameElement().denotesName()) {
+            if (rp.getLength() == 1 && rp.denotesName()) {
                 // a single path element must always denote a name. '.' and '..'
                 // will never point to a property. If the NodeEntry does not
                 // contain such a property entry, the targetEntry is 'null;
-                Name propName = rp.getNameElement().getName();
+                Name propName = rp.getName();
                 // check if property entry exists
                 targetEntry = getNodeEntry().getPropertyEntry(propName, true);
             } else {

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java Wed Sep 15 12:17:44 2010
@@ -485,7 +485,7 @@ public class NodeEntryImpl extends Hiera
             // all node entries present in the hierarchy and the direct ancestor
             // has already been resolved and isn't invalidated -> no need to
             // retrieve property entry from SPI
-            pe = entry.properties.get(path.getNameElement().getName());
+            pe = entry.properties.get(path.getName());
         } else {
             /*
             * Unknown parent entry (not-existing or not yet loaded) or a parent
@@ -502,8 +502,10 @@ public class NodeEntryImpl extends Hiera
 
             IdFactory idFactory = getIdFactory();
             NodeId parentId = entry.getWorkspaceId();
-            parentId = (remainingPath.getLength() == 1) ? parentId : idFactory.createNodeId(parentId, remainingPath.getAncestor(1));
-            PropertyId propId = idFactory.createPropertyId(parentId, remainingPath.getNameElement().getName());
+            if (remainingPath.getLength() != 1) {
+                parentId = idFactory.createNodeId(parentId, remainingPath.getAncestor(1));
+            }
+            PropertyId propId = idFactory.createPropertyId(parentId, remainingPath.getName());
             pe = entry.loadPropertyEntry(propId);
         }
 
@@ -898,7 +900,7 @@ public class NodeEntryImpl extends Hiera
     public void refresh(Event childEvent) {
         ItemId eventId = childEvent.getItemId();
         Path eventPath = childEvent.getPath();
-        Name eventName = eventPath.getNameElement().getName();
+        Name eventName = eventPath.getName();
         HierarchyEntry child = lookupEntry(eventId, eventPath);
 
         switch (childEvent.getType()) {
@@ -909,7 +911,7 @@ public class NodeEntryImpl extends Hiera
                     // removed already -> add the new entry.
                     if (childEvent.getType() ==  Event.NODE_ADDED) {
                         String uniqueChildID = (eventId.getPath() == null) ? eventId.getUniqueID() : null;
-                        int index = eventPath.getNameElement().getNormalizedIndex();
+                        int index = eventPath.getNormalizedIndex();
                         internalAddNodeEntry(eventName, uniqueChildID, index);
                     } else {
                         internalAddPropertyEntry(eventName, true);
@@ -1193,11 +1195,11 @@ public class NodeEntryImpl extends Hiera
      * <code>Status#NEW</code>.
      */
     private HierarchyEntry lookupEntry(ItemId eventId, Path eventPath) {
-        Name childName = eventPath.getNameElement().getName();
+        Name childName = eventPath.getName();
         HierarchyEntry child;
         if (eventId.denotesNode()) {
             String uniqueChildID = (eventId.getPath() == null) ? eventId.getUniqueID() : null;
-            int index = eventPath.getNameElement().getNormalizedIndex();
+            int index = eventPath.getNormalizedIndex();
             child = lookupNodeEntry(uniqueChildID, childName, index);
         } else {
             child = lookupPropertyEntry(childName);

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java Wed Sep 15 12:17:44 2010
@@ -53,15 +53,14 @@ public abstract class AbstractCopy exten
         this.destParentState = getNodeState(destPath.getAncestor(1), destMgrProvider.getHierarchyManager());
 
         // check for illegal index present in destination path
-        Path.Element destElement = destPath.getNameElement();
-        int index = destElement.getIndex();
-        if (index > Path.INDEX_UNDEFINED) {
+        int index = destPath.getIndex();
+        if (index != Path.INDEX_UNDEFINED) {
             // subscript in name element
             String msg = "invalid destination path (subscript in name element is not allowed)";
             log.debug(msg);
             throw new RepositoryException(msg);
         }
-        this.destName = destElement.getName();
+        this.destName = destPath.getName();
         this.srcWorkspaceName = srcWorkspaceName;
 
         // NOTE: affected-states only needed for transient modifications

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java Wed Sep 15 12:17:44 2010
@@ -160,10 +160,10 @@ public class Move extends AbstractOperat
             log.debug(msg);
             throw new RepositoryException(msg);
         }
-        Path.Element destElement = destPath.getNameElement();
+
         // destination must not contain an index
-        int index = destElement.getIndex();
-        if (index > Path.INDEX_UNDEFINED) {
+        int index = destPath.getIndex();
+        if (index != Path.INDEX_UNDEFINED) {
             // subscript in name element
             String msg = "Invalid destination path: subscript in name element is not allowed (" + LogUtil.safeGetJCRPath(destPath, resolver) + ")";
             log.debug(msg);
@@ -179,7 +179,7 @@ public class Move extends AbstractOperat
         NodeState srcState = getNodeState(srcPath, hierMgr);
         NodeState srcParentState = getNodeState(srcPath.getAncestor(1), hierMgr);
         NodeState destParentState = getNodeState(destPath.getAncestor(1), hierMgr);
-        Name destName = destElement.getName();
+        Name destName = destPath.getName();
 
         if (sessionMove) {
             NodeEntry destEntry = (NodeEntry) destParentState.getHierarchyEntry();

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java Wed Sep 15 12:17:44 2010
@@ -112,13 +112,19 @@ public class ReorderNodes extends Abstra
 
     //------------------------------------------------------------< Factory >---
 
-    public static Operation create(NodeState parentState, Path.Element srcName,
-                                   Path.Element beforeName) throws ItemNotFoundException, RepositoryException {
+    public static Operation create(
+            NodeState parentState, Path srcPath, Path beforePath)
+            throws ItemNotFoundException, RepositoryException {
         // make sure the parent hierarchy entry has its child entries loaded
         assertChildNodeEntries(parentState);
 
-        NodeState insert = parentState.getChildNodeState(srcName.getName(), srcName.getNormalizedIndex());
-        NodeState before = (beforeName == null) ? null : parentState.getChildNodeState(beforeName.getName(), beforeName.getNormalizedIndex());
+        NodeState insert = parentState.getChildNodeState(
+                srcPath.getName(), srcPath.getNormalizedIndex());
+        NodeState before = null;
+        if (beforePath != null) {
+            before = parentState.getChildNodeState(
+                    beforePath.getName(), beforePath.getNormalizedIndex());
+        }
         return new ReorderNodes(parentState, insert, before);
     }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java Wed Sep 15 12:17:44 2010
@@ -339,8 +339,9 @@ public final class ItemInfoBuilder {
             return transformIterator(itemInfos.iterator(),
                     new Transformer<ItemInfo, ChildInfo>(){
                         public ChildInfo transform(ItemInfo info) {
-                            Name name = info.getPath().getNameElement().getName();
-                            return new ChildInfoImpl(name, null, Path.INDEX_DEFAULT);
+                            return new ChildInfoImpl(
+                                    info.getPath().getName(), null,
+                                    Path.INDEX_DEFAULT);
                         }
                     });
         }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java Wed Sep 15 12:17:44 2010
@@ -524,8 +524,7 @@ public class ConsolidatingChangeLog exte
             }
 
             private boolean hasSNS(NodeId nodeId) {
-                Path p = ConsolidatingChangeLog.getPath(nodeId);
-                return p.getNameElement().getIndex() > 1;
+                return ConsolidatingChangeLog.getPath(nodeId).getIndex() > 1;
             }
         }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/identifier/AbstractIdFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/identifier/AbstractIdFactory.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/identifier/AbstractIdFactory.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/identifier/AbstractIdFactory.java Wed Sep 15 12:17:44 2010
@@ -279,7 +279,7 @@ public abstract class AbstractIdFactory 
         }
 
         public Name getName() {
-            return getPath().getNameElement().getName();
+            return getPath().getName();
         }
 
         @Override

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/AbstractPath.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/AbstractPath.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/AbstractPath.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/AbstractPath.java Wed Sep 15 12:17:44 2010
@@ -142,13 +142,19 @@ abstract class AbstractPath implements P
     public final Path resolve(Path relative) {
         if (relative.isAbsolute()) {
             return relative;
+        } else if (relative.getLength() > 1) {
+            Path first = relative.getFirstElements();
+            Path last = relative.getLastElement();
+            return resolve(first).resolve(last);
+        } else if (relative.denotesCurrent()) {
+            return new CurrentPath(this);
+        } else if (relative.denotesParent()) {
+            return new ParentPath(this);
+        } else if (relative.denotesName()) {
+            return new NamePath(this, relative.getNameElement());
         } else {
-            Path path = this;
-            int n = relative.getLength();
-            if (n > 1) {
-                path = resolve(relative.subPath(0, n - 1));
-            }
-            return path.resolve(relative.getNameElement());
+            throw new IllegalArgumentException(
+                    "Unknown path type: " + relative);
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java Wed Sep 15 12:17:44 2010
@@ -114,4 +114,23 @@ final class CurrentPath extends Relative
         }
     }
 
+    //--------------------------------------------------------------< Object >
+
+    @Override
+    public final boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        } else if (that instanceof Path) {
+            Path path = (Path) that;
+            return path.denotesCurrent() && super.equals(that);
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public final int hashCode() {
+        return super.hashCode() + 1;
+    }
+
 }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java Wed Sep 15 12:17:44 2010
@@ -77,7 +77,7 @@ final class NamePath extends RelativePat
     public boolean isNormalized() {
         return parent == null
             || (parent.isNormalized()
-                    && !parent.getNameElement().denotesCurrent());
+                    && !parent.denotesCurrent());
     }
 
     public Path getNormalizedPath() throws RepositoryException {
@@ -86,7 +86,7 @@ final class NamePath extends RelativePat
         } else {
             // parent is guaranteed to be !null
             Path normalized = parent.getNormalizedPath();
-            if (normalized.getNameElement().denotesCurrent()) {
+            if (normalized.denotesCurrent()) {
                 normalized = null; // special case: ./a
             }
             return new NamePath(normalized, element);
@@ -126,4 +126,25 @@ final class NamePath extends RelativePat
         }
     }
 
+    //--------------------------------------------------------------< Object >
+
+    @Override
+    public final boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        } else if (that instanceof Path) {
+            Path path = (Path) that;
+            return path.denotesName()
+                && element.equals(path.getNameElement()) 
+                && super.equals(that);
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public final int hashCode() {
+        return super.hashCode() * 37 + element.hashCode();
+    }
+
 }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java Wed Sep 15 12:17:44 2010
@@ -73,8 +73,7 @@ final class ParentPath extends RelativeP
 
     public boolean isNormalized() {
         return parent == null
-            || (parent.isNormalized()
-                    && parent.getNameElement().denotesParent());
+            || (parent.isNormalized() && parent.denotesParent());
     }
 
     public Path getNormalizedPath() throws RepositoryException {
@@ -83,9 +82,9 @@ final class ParentPath extends RelativeP
         } else {
             // parent is guaranteed to be !null
             Path normalized = parent.getNormalizedPath();
-            if (normalized.getNameElement().denotesParent()) {
+            if (normalized.denotesParent()) {
                 return new ParentPath(normalized); // special case: ../..
-            } else if (normalized.getNameElement().denotesCurrent()) {
+            } else if (normalized.denotesCurrent()) {
                 return new ParentPath(null); // special case: ./..
             } else {
                 return normalized.getAncestor(1);
@@ -124,4 +123,23 @@ final class ParentPath extends RelativeP
         }
     }
 
+    //--------------------------------------------------------------< Object >
+
+    @Override
+    public final boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        } else if (that instanceof Path) {
+            Path path = (Path) that;
+            return path.denotesParent() && super.equals(that);
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public final int hashCode() {
+        return super.hashCode() + 2;
+    }
+
 }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java Wed Sep 15 12:17:44 2010
@@ -40,7 +40,7 @@ public class PathMap<T> {
      * Root element
      */
     private final Element<T> root =
-        new Element<T>(PATH_FACTORY.getRootPath().getNameElement());
+        new Element<T>(PATH_FACTORY.getRootElement());
 
     /**
      * Map a path to a child. If <code>exact</code> is <code>false</code>,
@@ -459,9 +459,9 @@ public class PathMap<T> {
          */
         public Path.Element getPathElement() {
             if (index < Path.INDEX_DEFAULT) {
-                return PATH_FACTORY.create(getName()).getNameElement();
+                return PATH_FACTORY.createElement(getName());
             } else {
-                return PATH_FACTORY.create(getName(), index).getNameElement();
+                return PATH_FACTORY.createElement(getName(), index);
             }
         }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java Wed Sep 15 12:17:44 2010
@@ -98,20 +98,10 @@ abstract class RelativePath extends Abst
             return this;
         } else if (to < length) {
             return parent.subPath(from, to);
+        } else if (from < to - 1) {
+            return parent.subPath(from, to - 1).resolve(getLastElement());
         } else {
-            Element element = getNameElement();
-            if (from < to - 1) {
-                return parent.subPath(from, to - 1).resolve(element);
-            } else if (element.denotesName()) {
-                return new NamePath(null, element);
-            } else if (element.denotesParent()) {
-                return new ParentPath(null);
-            } else if (element.denotesCurrent()) {
-                return new CurrentPath(null);
-            } else {
-                throw new IllegalStateException(
-                        "Unknown path element type: " + element);
-            }
+            return getLastElement();
         }
     }
 
@@ -136,14 +126,12 @@ abstract class RelativePath extends Abst
 
     //--------------------------------------------------------------< Object >
 
-    public final boolean equals(Object that) {
+    public boolean equals(Object that) {
         if (this == that) {
             return true;
         } else if (that instanceof RelativePath) {
             RelativePath path = (RelativePath) that;
-            if (!getNameElement().equals(path.getNameElement())) {
-                return false;
-            } else if (parent != null) {
+            if (parent != null) {
                 return parent.equals(path.parent);
             } else {
                 return path.parent == null;
@@ -153,13 +141,12 @@ abstract class RelativePath extends Abst
         }
     }
 
-    public final int hashCode() {
-        int h = 17;
+    public int hashCode() {
         if (parent != null) {
-            h = h * 37 + parent.hashCode();
+            return parent.hashCode();
+        } else {
+            return 17;
         }
-        h = h * 37 + getNameElement().hashCode();
-        return h;
     }
 
 }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java Wed Sep 15 12:17:44 2010
@@ -179,7 +179,7 @@ public class OrderQueryNode extends Quer
          * @deprecated use {@link #getPropertyPath()} instead.
          */
         public Name getProperty() {
-            return property.getNameElement().getName();
+            return property.getName();
         }
 
         /**

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java Wed Sep 15 12:17:44 2010
@@ -99,7 +99,7 @@ public class TextsearchQueryNode extends
      * @deprecated Use {@link #getRelativePath()} instead.
      */
     public Name getPropertyName() {
-        return relPath == null ? null : relPath.getNameElement().getName();
+        return relPath == null ? null : relPath.getName();
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java Wed Sep 15 12:17:44 2010
@@ -291,7 +291,7 @@ class QueryFormat implements QueryNodeVi
                 exceptions.add(new InvalidQueryException("Child axis not supported in SQL"));
             } else {
                 try {
-                    appendName(node.getRelativePath().getNameElement().getName(), resolver, sb);
+                    appendName(node.getRelativePath().getName(), resolver, sb);
                 } catch (NamespaceException e) {
                     exceptions.add(e);
                 }
@@ -489,7 +489,7 @@ class QueryFormat implements QueryNodeVi
                         exceptions.add(new InvalidQueryException("SQL does not support relative paths in order by clause"));
                         return sb;
                     }
-                    appendName(propPath.getNameElement().getName(), resolver, sb);
+                    appendName(propPath.getName(), resolver, sb);
                     if (!specs[i].isAscending()) {
                         sb.append(" DESC");
                     }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java Wed Sep 15 12:17:44 2010
@@ -380,7 +380,7 @@ public class ConsolidatedBatchTest exten
 
     public PropertyId createPropertyId(String propertyId) throws RepositoryException {
         Path path = createPath(propertyId);
-        return idFactory.createPropertyId(createNodeId(path.getAncestor(1)), path.getNameElement().getName());
+        return idFactory.createPropertyId(createNodeId(path.getAncestor(1)), path.getName());
     }
 
     private QValue createValue(String value, int type) throws RepositoryException {
@@ -395,7 +395,7 @@ public class ConsolidatedBatchTest exten
 
         public TestChangeLog addNode(String nodeId) throws RepositoryException {
             Path path = createPath(nodeId);
-            addNode(createNodeId(path.getAncestor(1)), path.getNameElement().getName(),
+            addNode(createNodeId(path.getAncestor(1)), path.getName(),
                     createName("anyType"), null);
 
             return this;
@@ -403,13 +403,13 @@ public class ConsolidatedBatchTest exten
 
         public TestChangeLog addProp(String propertyId, String value, int type) throws RepositoryException {
             Path path = createPath(propertyId);
-            addProperty(createNodeId(path.getAncestor(1)), path.getNameElement().getName(), createValue(value, type));
+            addProperty(createNodeId(path.getAncestor(1)), path.getName(), createValue(value, type));
             return this;
         }
 
         public TestChangeLog movItem(String srcNodeId, String destNodeId) throws RepositoryException {
             Path path = createPath(destNodeId);
-            move(createNodeId(srcNodeId), createNodeId(path.getAncestor(1)), path.getNameElement().getName());
+            move(createNodeId(srcNodeId), createNodeId(path.getAncestor(1)), path.getName());
             return this;
         }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathFactoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathFactoryTest.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathFactoryTest.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathFactoryTest.java Wed Sep 15 12:17:44 2010
@@ -224,7 +224,7 @@ public class PathFactoryTest extends Tes
         assertEquals(1, p.getLength());
         assertEquals(0, p.getAncestorCount());
 
-        Path.Element lastElem = p.getNameElement();
+        Path lastElem = p.getLastElement();
         assertNotNull(lastElem);
         assertTrue(lastElem.denotesIdentifier());
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathTest.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathTest.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/name/PathTest.java Wed Sep 15 12:17:44 2010
@@ -530,7 +530,7 @@ public class PathTest extends TestCase {
                 }
                 // subpath name element
                 if (p.getLength() > 2) {
-                    Path expected = factory.create(new Path.Element[] {p.getNameElement()});
+                    Path expected = p.getLastElement();
                     assertEquals(expected, p.subPath(p.getLength()-1, p.getLength()));
                 }
             }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathOrderByTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathOrderByTest.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathOrderByTest.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathOrderByTest.java Wed Sep 15 12:17:44 2010
@@ -53,7 +53,7 @@ public class XPathOrderByTest extends Te
         checkName(Name.NS_DEFAULT_URI, "bar", specs[0].getProperty());
         Path propPath = specs[0].getPropertyPath();
         assertEquals(1, propPath.getLength());
-        checkName(Name.NS_DEFAULT_URI, "bar", propPath.getNameElement().getName());
+        checkName(Name.NS_DEFAULT_URI, "bar", propPath.getName());
     }
 
     public void testAscending() throws Exception {

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ItemInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ItemInfoImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ItemInfoImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/ItemInfoImpl.java Wed Sep 15 12:17:44 2010
@@ -58,7 +58,7 @@ public abstract class ItemInfoImpl imple
      * {@inheritDoc}
      */
     public Name getName() {
-        return path.getNameElement().getName();
+        return path.getName();
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java Wed Sep 15 12:17:44 2010
@@ -64,7 +64,7 @@ public class NodeInfoImpl extends ItemIn
     }
 
     public int getIndex() {
-        return getPath().getNameElement().getNormalizedIndex();
+        return getPath().getNormalizedIndex();
     }
 
     public Name getNodetype() {

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java Wed Sep 15 12:17:44 2010
@@ -812,8 +812,8 @@ public class RepositoryServiceImpl exten
 
         private Path calcRemovePath(Path removedNodePath) throws RepositoryException {
             removed.put(removedNodePath, removedNodePath);
-            Name name = removedNodePath.getNameElement().getName();
-            int index = removedNodePath.getNameElement().getNormalizedIndex();
+            Name name = removedNodePath.getName();
+            int index = removedNodePath.getNormalizedIndex();
             if (index > Path.INDEX_DEFAULT) {
                 Path.Element[] elems = removedNodePath.getElements();
                 PathBuilder pb = new PathBuilder();

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/test/java/org/apache/jackrabbit/spi2davex/ExtensionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/test/java/org/apache/jackrabbit/spi2davex/ExtensionTest.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/test/java/org/apache/jackrabbit/spi2davex/ExtensionTest.java (original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/test/java/org/apache/jackrabbit/spi2davex/ExtensionTest.java Wed Sep 15 12:17:44 2010
@@ -98,13 +98,13 @@ public class ExtensionTest extends Abstr
 
         NodeInfo nInfo = rs.getNodeInfo(si, getNodeId(path));
         //System.out.println("NodeInfo: " + nInfo.getPath().getNameElement().getName());
-        assertEquals(testName, nInfo.getPath().getNameElement().getName());
+        assertEquals(testName, nInfo.getPath().getName());
 
         Iterator<? extends ItemInfo > it = rs.getItemInfos(si, getNodeId(path));
         assertTrue(it.hasNext());
         nInfo = (NodeInfo) it.next();
         //System.out.println("ItemInfo: " + nInfo.getPath().getNameElement().getName());
-        assertEquals(testName, nInfo.getPath().getNameElement().getName());
+        assertEquals(testName, nInfo.getPath().getName());
     }
 
     public void testJsonExtension() throws RepositoryException {
@@ -141,13 +141,13 @@ public class ExtensionTest extends Abstr
 
          NodeInfo nInfo = rs.getNodeInfo(si, getNodeId("/test[2]"));
          //System.out.println("NodeInfo: " + nInfo.getPath().getNameElement().getName());
-         assertEquals(testName, nInfo.getPath().getNameElement().getName());
+         assertEquals(testName, nInfo.getPath().getName());
 
          Iterator<? extends ItemInfo> it = rs.getItemInfos(si, getNodeId("/test[2]"));
          assertTrue(it.hasNext());
          nInfo = (NodeInfo) it.next();
          //System.out.println("ItemInfo: " + nInfo.getPath().getNameElement().getName());
-         assertEquals(testName, nInfo.getPath().getNameElement().getName());
+         assertEquals(testName, nInfo.getPath().getName());
 
          removeTestNode("/test[2]");
      }

Modified: jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventFactory.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventFactory.java (original)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventFactory.java Wed Sep 15 12:17:44 2010
@@ -93,8 +93,7 @@ class EventFactory {
                 case Event.PROPERTY_CHANGED:
                     node = session.getItem(e.getPath()).getParent();
                 case Event.PROPERTY_REMOVED:
-                    itemId = idFactory.createPropertyId(parentId,
-                            p.getNameElement().getName());
+                    itemId = idFactory.createPropertyId(parentId, p.getName());
                     break;
                 case Event.PERSIST:
                 default:

Modified: jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java?rev=997303&r1=997302&r2=997303&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java Wed Sep 15 12:17:44 2010
@@ -1507,14 +1507,14 @@ public class RepositoryServiceImpl imple
             Path p = itemId.getPath();
             if (p != null) {
                 removedNodeIds.add(nodeId);
-                int index = p.getNameElement().getNormalizedIndex();
+                int index = p.getNormalizedIndex();
                 if (index > Path.INDEX_DEFAULT) {
                     Path.Element[] elems = p.getElements();
                     PathBuilder pb = new PathBuilder();
                     for (int i = 0; i <= elems.length - 2; i++) {
                         pb.addLast(elems[i]);
                     }
-                    pb.addLast(p.getNameElement().getName(), index - 1);
+                    pb.addLast(p.getName(), index - 1);
 
                     NodeId prevSibling = idFactory.createNodeId(itemId.getUniqueID(), pb.getPath());
                     if (removedNodeIds.contains(prevSibling)) {



Mime
View raw message