Ard Schrijvers wrote:
Christoph Kiehl wrote:
I made some changes to the ChildAxisScorer while working on JCR-1041.
Unfortunately I don't have the time right now to check if I
introduced this bug.
I'll try to have a look later this day. Feel free to check
the affected revisions.
When reverting to revision before these changes the problem did not occur. The problem appears to be, that in
ChildAxisQuery.ChildAxisScorer.skiptTo(int) the skipTo(target) can return -1 (leading to problem in reader.document(i) where i = -1 ). adding
if(nextDoc == -1) {
return false;
}
after nextDoc in the code snippet below solves the problem. But, I am not sure wether it should be avoided in the skipTo in the first place?
public boolean skipTo(int target) throws IOException {
calculateChildren();
nextDoc = hits.skipTo(target);
while (!indexIsValid(nextDoc))
next();
return nextDoc > -1;
}
WDYT? Shall I re-open the JCR-1041?
Thanks a lot for tracking this down! Committed your suggestion slightly modified
in rev 572885.
Cheers,
Christoph