Author: skabashnyuk
Date: 2010-02-09 09:08:57 -0500 (Tue, 09 Feb 2010)
New Revision: 1738
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java
Log:
EXOJCR-395 : check index possition
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java 2010-02-09
13:44:35 UTC (rev 1737)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java 2010-02-09
14:08:57 UTC (rev 1738)
@@ -554,7 +554,7 @@
// check if doc is a descendant of one of the context nodes
pDocs = hResolver.getParents(doc, pDocs);
- if (pDocs.length == 0) {
+ if (pDocs.length == 0 && pDocs[0] > 0) {
return false;
}
@@ -566,7 +566,8 @@
while (pDocs.length != 0) {
boolean valid = false;
for (int i = 0; i < pDocs.length; i++) {
- if (ancestorCount >= minLevels &&
contextHits.get(pDocs[i])) {
+ int pDoci = pDocs[i];
+ if (pDoci > 0 && pDoci <= contextHits.size() &&
ancestorCount >= minLevels && contextHits.get(pDoci)) {
valid = true;
break;
}