jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r596274 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocId.java
Date Mon, 19 Nov 2007 11:32:16 GMT
Author: mreutegg
Date: Mon Nov 19 03:32:09 2007
New Revision: 596274

URL: http://svn.apache.org/viewvc?rev=596274&view=rev
Log:
JCR-1214: DocId.UUIDDocId should not have a string attr uuid

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocId.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocId.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocId.java?rev=596274&r1=596273&r2=596274&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocId.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocId.java
Mon Nov 19 03:32:09 2007
@@ -19,6 +19,7 @@
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermDocs;
+import org.apache.jackrabbit.uuid.UUID;
 
 import java.io.IOException;
 import java.util.BitSet;
@@ -174,9 +175,9 @@
     private static final class UUIDDocId extends DocId {
 
         /**
-         * The node uuid or <code>null</code> if not set.
+         * The node uuid.
          */
-        private final String uuid;
+        private final UUID uuid;
 
         /**
          * The index reader that was used to calculate the document number.
@@ -194,9 +195,11 @@
          * Creates a <code>DocId</code> based on a Node uuid.
          *
          * @param uuid the Node uuid.
+         * @throws IllegalArgumentException if the <code>uuid</code> is
+         *                                  malformed.
          */
         UUIDDocId(String uuid) {
-            this.uuid = uuid;
+            this.uuid = UUID.fromString(uuid);
         }
 
         /**
@@ -208,7 +211,7 @@
                     return docNumber;
                 }
             }
-            Term id = new Term(FieldNames.UUID, uuid);
+            Term id = new Term(FieldNames.UUID, uuid.toString());
             TermDocs docs = reader.termDocs(id);
             int doc = -1;
             try {



Mime
View raw message