jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r596286 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocId.java
Date Mon, 19 Nov 2007 13:08:48 GMT
Author: mreutegg
Date: Mon Nov 19 05:08:47 2007
New Revision: 596286

URL: http://svn.apache.org/viewvc?rev=596286&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=596286&r1=596285&r2=596286&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 05:08:47 2007
@@ -175,9 +175,14 @@
     private static final class UUIDDocId extends DocId {
 
         /**
-         * The node uuid.
+         * The least significant 64 bits of the uuid (bytes 8-15)
          */
-        private final UUID uuid;
+        private final long lsb;
+
+        /**
+         * The most significant 64 bits of the uuid (bytes 0-7)
+         */
+        private final long msb;
 
         /**
          * The index reader that was used to calculate the document number.
@@ -199,7 +204,9 @@
          *                                  malformed.
          */
         UUIDDocId(String uuid) {
-            this.uuid = UUID.fromString(uuid);
+            UUID tmp = UUID.fromString(uuid);
+            this.lsb = tmp.getLeastSignificantBits();
+            this.msb = tmp.getMostSignificantBits();
         }
 
         /**
@@ -211,7 +218,7 @@
                     return docNumber;
                 }
             }
-            Term id = new Term(FieldNames.UUID, uuid.toString());
+            Term id = new Term(FieldNames.UUID, new UUID(msb, lsb).toString());
             TermDocs docs = reader.termDocs(id);
             int doc = -1;
             try {
@@ -254,7 +261,7 @@
          * @return a String representation for this <code>DocId</code>.
          */
         public String toString() {
-            return "UUIDDocId(" + uuid + ")";
+            return "UUIDDocId(" + new UUID(msb, lsb) + ")";
         }
     }
 }



Mime
View raw message