jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r793047 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/ main/java/org/apache/jackrabbit/core/id/ main/java/org/apache/jackrabbit/core/journal/ main/java/org/apache/jackrabbit/core/nodetype/virtual/ main/jav...
Date Fri, 10 Jul 2009 17:35:25 GMT
Author: jukka
Date: Fri Jul 10 17:35:25 2009
New Revision: 793047

URL: http://svn.apache.org/viewvc?rev=793047&view=rev
Log:
JCR-1232: Merge UUID to NodeId

Get rid of most of the NodeId(UUID) constructor calls.

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/NodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractRecord.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingQueue.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryHits.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/ClusterRecordTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/UpdateEventFactory.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.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=793047&r1=793046&r2=793047&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
Fri Jul 10 17:35:25 2009
@@ -1108,7 +1108,7 @@
         }
         if (id == null) {
             // create new id
-            id = new NodeId(UUID.randomUUID());
+            id = new NodeId();
         }
         if (nodeTypeName == null) {
             // no primary node type specified,
@@ -1688,7 +1688,7 @@
             switch (flag) {
                 case COPY:
                     // always create new uuid
-                    id = new NodeId(UUID.randomUUID());
+                    id = new NodeId();
                     if (referenceable) {
                         // remember uuid mapping
                         refTracker.mappedId(srcState.getNodeId(), id);
@@ -1697,7 +1697,7 @@
                 case CLONE:
                     if (!referenceable) {
                         // non-referenceable node: always create new uuid
-                        id = new NodeId(UUID.randomUUID());
+                        id = new NodeId();
                         break;
                     }
                     // use same uuid as source node
@@ -1710,7 +1710,7 @@
                 case CLONE_REMOVE_EXISTING:
                     if (!referenceable) {
                         // non-referenceable node: always create new uuid
-                        id = new NodeId(UUID.randomUUID());
+                        id = new NodeId();
                         break;
                     }
                     // use same uuid as source node

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=793047&r1=793046&r2=793047&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
Fri Jul 10 17:35:25 2009
@@ -543,7 +543,7 @@
         NodeState nodeState;
         try {
             if (id == null) {
-                id = new NodeId(UUID.randomUUID());
+                id = new NodeId();
             }
             nodeState =
                     stateMgr.createTransientNodeState(id, nodeType.getQName(),

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
Fri Jul 10 17:35:25 2009
@@ -38,6 +38,10 @@
         super(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
     }
 
+    public NodeId() {
+        this(UUID.randomUUID());
+    }
+
     /**
      * Creates a node identifier from the given UUID string.
      *

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
Fri Jul 10 17:35:25 2009
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.core.id;
 
-import org.apache.jackrabbit.uuid.UUID;
-
 import java.io.Serializable;
 
 /**
@@ -34,17 +32,6 @@
     private final NodeId targetId;
 
     /**
-     * Creates a new instance of this class. Takes the uuid of the target node
-     * as parameter.
-     *
-     * @param uuid uuid of target node
-     * @throws IllegalArgumentException if <code>uuid</code> is <code>null</code>.
-     */
-    public NodeReferencesId(UUID uuid) {
-        targetId = new NodeId(uuid);
-    }
-
-    /**
      * Creates a new instance of this class. Takes the id of the target node
      * as parameter.
      *

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractRecord.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractRecord.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractRecord.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractRecord.java
Fri Jul 10 17:35:25 2009
@@ -228,7 +228,7 @@
         } else if (uuidType == UUID_LITERAL) {
             byte[] b = new byte[Constants.UUID_BYTE_LENGTH];
             readFully(b);
-            NodeId nodeId = new NodeId(new UUID(b));
+            NodeId nodeId = new NodeId(b);
             nodeIdIndex.put(nodeId, nodeIdIndex.size());
             return nodeId;
         } else {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
Fri Jul 10 17:35:25 2009
@@ -39,7 +39,6 @@
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.QValueConstraint;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
-import org.apache.jackrabbit.uuid.UUID;
 
 /**
  * This Class implements a virtual item state provider that exposes the
@@ -156,7 +155,7 @@
     private VirtualNodeState createNodeTypeState(VirtualNodeState parent,
                                                  NodeTypeDef ntDef)
             throws RepositoryException {
-        NodeId id = new NodeId(calculateStableUUID(ntDef.getName().toString()));
+        NodeId id = calculateStableId(ntDef.getName().toString());
         VirtualNodeState ntState = createNodeState(parent, ntDef.getName(), id, NameConstants.NT_NODETYPE);
 
         // add properties
@@ -201,8 +200,8 @@
                                                     PropDef propDef,
                                                     NodeTypeDef ntDef, int n)
             throws RepositoryException {
-        NodeId id = new NodeId(calculateStableUUID(
-                ntDef.getName().toString() + "/" + NameConstants.JCR_PROPERTYDEFINITION.toString()
+ "/" + n));
+        NodeId id = calculateStableId(
+                ntDef.getName().toString() + "/" + NameConstants.JCR_PROPERTYDEFINITION.toString()
+ "/" + n);
         VirtualNodeState pState = createNodeState(
                 parent, NameConstants.JCR_PROPERTYDEFINITION, id,
                 NameConstants.NT_PROPERTYDEFINITION);
@@ -250,8 +249,8 @@
                                                      NodeDef cnDef,
                                                      NodeTypeDef ntDef, int n)
             throws RepositoryException {
-        NodeId id = new NodeId(calculateStableUUID(
-                ntDef.getName().toString() + "/" + NameConstants.JCR_CHILDNODEDEFINITION.toString()
+ "/" + n));
+        NodeId id = calculateStableId(
+                ntDef.getName().toString() + "/" + NameConstants.JCR_CHILDNODEDEFINITION.toString()
+ "/" + n);
         VirtualNodeState pState = createNodeState(
                 parent, NameConstants.JCR_CHILDNODEDEFINITION, id, NameConstants.NT_CHILDNODEDEFINITION);
         // add properties
@@ -273,18 +272,18 @@
     }
 
     /**
-     * Calclulates a stable uuid out of the given string. The alogrith does a
-     * MD5 digest from the string an converts it into the uuid format.
+     * Calculates a stable identifier out of the given string. The algorithm
+     * does a MD5 digest from the string an converts it into the UUID format.
      *
      * @param name
      * @return
      * @throws RepositoryException
      */
-    private static UUID calculateStableUUID(String name) throws RepositoryException {
+    private static NodeId calculateStableId(String name) throws RepositoryException {
         try {
             MessageDigest md = MessageDigest.getInstance("MD5");
             byte[] digest = md.digest(name.getBytes("utf-8"));
-            return new UUID(digest);
+            return new NodeId(digest);
         } catch (NoSuchAlgorithmException e) {
             throw new RepositoryException(e);
         } catch (UnsupportedEncodingException e) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
Fri Jul 10 17:35:25 2009
@@ -809,9 +809,9 @@
                 while (rs.next()) {
                     NodeId id;
                     if (getStorageModel() == SM_BINARY_KEYS) {
-                        id = new NodeId(new UUID(rs.getBytes(1)));
+                        id = new NodeId(rs.getBytes(1));
                     } else {
-                        id = new NodeId(new UUID(rs.getLong(1), rs.getLong(2)));
+                        id = new NodeId(rs.getLong(1), rs.getLong(2));
                     }
 
                     // issuing 2nd statement to circumvent issue JCR-1474

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
Fri Jul 10 17:35:25 2009
@@ -295,7 +295,7 @@
         if (in.readBoolean()) {
             byte[] bytes = new byte[16];
             in.readFully(bytes);
-            return new NodeId(new UUID(bytes));
+            return new NodeId(bytes);
         } else {
             return null;
         }
@@ -360,7 +360,7 @@
             while (pos < 16) {
                 pos += in.read(bytes, pos, 16 - pos);
             }
-            return new NodeId(new UUID(bytes));
+            return new NodeId(bytes);
         } else {
             return null;
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/Serializer.java
Fri Jul 10 17:35:25 2009
@@ -129,7 +129,7 @@
         byte[] uuidBytes = new byte[UUID.UUID_BYTE_LENGTH];
         in.readFully(uuidBytes);
         if (!Arrays.equals(uuidBytes, NULL_UUID_PLACEHOLDER_BYTES)) {
-            state.setParentId(new NodeId(new UUID(uuidBytes)));
+            state.setParentId(new NodeId(uuidBytes));
         }
         // definitionId
         s = in.readUTF();
@@ -157,7 +157,7 @@
             Name name = NameFactoryImpl.getInstance().create(in.readUTF());    // name
             // uuid
             in.readFully(uuidBytes);
-            state.addChildNodeEntry(name, new NodeId(new UUID(uuidBytes)));
+            state.addChildNodeEntry(name, new NodeId(uuidBytes));
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
Fri Jul 10 17:35:25 2009
@@ -151,7 +151,7 @@
         sanityCheck();
         List<Node> nodes = new ArrayList<Node>();
         try {
-            NodeId nodeId = new NodeId(UUID.fromString(node.getIdentifier()));
+            NodeId nodeId = new NodeId(node.getIdentifier());
             for (NodeId id : searchMgr.getWeaklyReferringNodes(nodeId)) {
                 nodes.add(session.getNodeById(id));
             }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
Fri Jul 10 17:35:25 2009
@@ -630,7 +630,7 @@
             Hits childrenHits = new AdaptingHits();
             for (Iterator it = uuids.values().iterator(); it.hasNext(); ) {
                 String uuid = (String) it.next();
-                NodeId id = new NodeId(UUID.fromString(uuid));
+                NodeId id = new NodeId(uuid);
                 try {
                     long time = System.currentTimeMillis();
                     NodeState state = (NodeState) itemMgr.getItemState(id);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingQueue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingQueue.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingQueue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingQueue.java
Fri Jul 10 17:35:25 2009
@@ -98,11 +98,10 @@
         String[] uuids = queueStore.getPending();
         for (int i = 0; i < uuids.length; i++) {
             try {
-                UUID uuid = UUID.fromString(uuids[i]);
-                Document doc = index.createDocument(new NodeId(uuid));
+                Document doc = index.createDocument(new NodeId(uuids[i]));
                 pendingDocuments.put(uuids[i], doc);
                 log.debug("added node {}. New size of indexing queue: {}",
-                        uuid, new Integer(pendingDocuments.size()));
+                        uuids[i], new Integer(pendingDocuments.size()));
             } catch (IllegalArgumentException e) {
                 log.warn("Invalid UUID in indexing queue store: " + uuids[i]);
             } catch (RepositoryException e) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryHits.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryHits.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryHits.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryHits.java
Fri Jul 10 17:35:25 2009
@@ -58,8 +58,7 @@
             return null;
         }
         int doc = scorer.doc();
-        String uuid = reader.document(doc).get(FieldNames.UUID);
-        NodeId id = new NodeId(UUID.fromString(uuid));
+        NodeId id = new NodeId(reader.document(doc).get(FieldNames.UUID));
         return new ScoreNode(id, scorer.score(), doc);
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java
Fri Jul 10 17:35:25 2009
@@ -187,7 +187,7 @@
                 IndexReader reader = readers.get(idx);
                 Document doc = reader.document(i.doc - starts[idx], FieldSelectors.UUID);
                 String uuid = doc.get(FieldNames.UUID);
-                Path path = hmgr.getPath(new NodeId(UUID.fromString(uuid)));
+                Path path = hmgr.getPath(new NodeId(uuid));
                 PathBuilder builder = new PathBuilder(path);
                 builder.addAll(relPath.getElements());
                 PropertyId id = hmgr.resolvePropertyPath(builder.getPath());

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java
Fri Jul 10 17:35:25 2009
@@ -158,7 +158,7 @@
         ScoreDoc[] docs = collector.topDocs().scoreDocs;
         for (int i = scoreNodes.size(); i < docs.length; i++) {
             String uuid = reader.document(docs[i].doc).get(FieldNames.UUID);
-            NodeId id = new NodeId(UUID.fromString(uuid));
+            NodeId id = new NodeId(uuid);
             scoreNodes.add(new ScoreNode(id, docs[i].score, docs[i].doc));
         }
         log.debug("getHits() {}/{}", scoreNodes.size(), numHits);

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/ClusterRecordTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/ClusterRecordTest.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/ClusterRecordTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/ClusterRecordTest.java
Fri Jul 10 17:35:25 2009
@@ -122,7 +122,7 @@
      * @throws Exception
      */
     public void testLockOperation() throws Exception {
-        LockEvent event = new LockEvent(new NodeId(UUID.randomUUID()), true, "admin");
+        LockEvent event = new LockEvent(new NodeId(), true, "admin");
 
         master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId(),
                 event.isDeep(), event.getUserId()).ended(true);
@@ -140,7 +140,7 @@
      * @throws Exception
      */
     public void testUnlockOperation() throws Exception {
-        UnlockEvent event = new UnlockEvent(new NodeId(UUID.randomUUID()));
+        UnlockEvent event = new UnlockEvent(new NodeId());
 
         master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId()).ended(true);
 

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/UpdateEventFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/UpdateEventFactory.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/UpdateEventFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/UpdateEventFactory.java
Fri Jul 10 17:35:25 2009
@@ -128,7 +128,7 @@
     protected NodeState createNodeState() {
         Name ntName = nameFactory.create("{}testnt");
         NodeState n = new NodeState(
-                new NodeId(UUID.randomUUID()), ntName,
+                new NodeId(), ntName,
                 ROOT_NODE_ID, NodeState.STATUS_EXISTING, false);
         n.setMixinTypeNames(Collections.EMPTY_SET);
         return n;

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java
Fri Jul 10 17:35:25 2009
@@ -118,7 +118,7 @@
 
                 log("Random access");
                 for (int j = 0; j < 50; j++) {
-                    after = new NodeId(UUID.randomUUID());
+                    after = new NodeId();
                     log(" bigger than: " + after);
                     for (NodeId id : apm.getAllNodeIds(after, 2)) {
                         log("    " + id);

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.java?rev=793047&r1=793046&r2=793047&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.java
Fri Jul 10 17:35:25 2009
@@ -19,7 +19,6 @@
 import java.io.IOException;
 
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.uuid.UUID;
 
 /**
  * <code>SlowQueryHandler</code> implements a dummy query handler for testing
@@ -37,8 +36,7 @@
         } catch (InterruptedException e) {
             // ignore
         }
-        NodeId id = new NodeId(UUID.randomUUID());
-        getContext().getItemStateManager().hasItemState(id);
+        getContext().getItemStateManager().hasItemState(new NodeId());
         super.doInit();
     }
 



Mime
View raw message