lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject svn commit: r1454850 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/misc/ lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java
Date Sun, 10 Mar 2013 13:38:22 GMT
Author: shaie
Date: Sun Mar 10 13:38:21 2013
New Revision: 1454850

URL: http://svn.apache.org/r1454850
Log:
make sure docs and offsets are the same length

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/misc/   (props changed)
    lucene/dev/branches/branch_4x/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java

Modified: lucene/dev/branches/branch_4x/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java?rev=1454850&r1=1454849&r2=1454850&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java
Sun Mar 10 13:38:21 2013
@@ -448,7 +448,11 @@ public class SortingAtomicReader extends
       while ((doc = in.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
         if (i == docs.length) {
           docs = ArrayUtil.grow(docs, docs.length + 1);
-          offsets = ArrayUtil.grow(offsets, offsets.length + 1);
+          // don't grow() offsets since growing pattern for long and int is not the same.
+          // since we want docs and offsets at the same length, just grow it manually.
+          long[] tmp = new long[docs.length];
+          System.arraycopy(offsets, 0, tmp, 0, offsets.length);
+          offsets = tmp;
         }
         docs[i] = old2new[doc];
         offsets[i] = out.getFilePointer();



Mime
View raw message