Author: skabashnyuk
Date: 2010-02-09 09:52:17 -0500 (Tue, 09 Feb 2010)
New Revision: 1740
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingMultiIndexReader.java
Log:
EXOJCR-395 : check index position
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingMultiIndexReader.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingMultiIndexReader.java 2010-02-09
14:10:35 UTC (rev 1739)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingMultiIndexReader.java 2010-02-09
14:52:17 UTC (rev 1740)
@@ -101,8 +101,12 @@
*/
public DocId getParentDocId(int n) throws IOException {
int i = readerIndex(n);
- DocId id = subReaders[i].getParent(n - starts[i]);
- return id.applyOffset(starts[i]);
+ DocId result = DocId.NULL;
+ if(i > -1 && starts[i] > -1 && (n - starts[i]) > -1) {
+ DocId id = subReaders[i].getParent(n - starts[i]);
+ result = id.applyOffset(starts[i]);
+ }
+ return result;
}
/**