Author: skabashnyuk
Date: 2010-02-09 10:36:28 -0500 (Tue, 09 Feb 2010)
New Revision: 1743
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/DescendantSelfAxisQuery.java
Log:
EXOJCR-395 : fix id equals
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
15:17:19 UTC (rev 1742)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingMultiIndexReader.java 2010-02-09
15:36:28 UTC (rev 1743)
@@ -102,7 +102,7 @@
public DocId getParentDocId(int n) throws IOException {
int i = readerIndex(n);
DocId result = DocId.NULL;
- if(i > -1 && starts[i] > -1 && (n - starts[i]) > -1) {
+ if(i >= 0 && starts[i] >= 0 && (n - starts[i]) >= 0) {
DocId id = subReaders[i].getParent(n - starts[i]);
result = id.applyOffset(starts[i]);
}
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
15:17:19 UTC (rev 1742)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java 2010-02-09
15:36:28 UTC (rev 1743)
@@ -567,7 +567,7 @@
boolean valid = false;
for (int i = 0; i < pDocs.length; i++) {
int pDoci = pDocs[i];
- if (pDoci > 0 && pDoci <= contextHits.size() &&
ancestorCount >= minLevels && contextHits.get(pDoci)) {
+ if (pDoci >= 0 && pDoci <= contextHits.size()
&& ancestorCount >= minLevels && contextHits.get(pDoci)) {
valid = true;
break;
}