mirror of https://github.com/apache/lucene.git
make sure docs and offsets are the same length
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1454849 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cf803eaf92
commit
3071009fda
|
@ -448,7 +448,11 @@ public class SortingAtomicReader extends FilterAtomicReader {
|
||||||
while ((doc = in.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
|
while ((doc = in.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
|
||||||
if (i == docs.length) {
|
if (i == docs.length) {
|
||||||
docs = ArrayUtil.grow(docs, docs.length + 1);
|
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];
|
docs[i] = old2new[doc];
|
||||||
offsets[i] = out.getFilePointer();
|
offsets[i] = out.getFilePointer();
|
||||||
|
|
Loading…
Reference in New Issue