You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Michael McCandless <lu...@mikemccandless.com> on 2021/08/28 21:14:51 UTC

Re: TopHits.scoreDocs is not final

Let's make this member final!

I vaguely remember this was tried before and it was ... difficult?  But I
could not find that past attempt!  Maybe it was just a horrible nightmare.

Mike

On Thu, Jul 22, 2021 at 12:36 PM Michael Sokolov <ms...@gmail.com> wrote:

> We encountered a very rare strange bug (looks like it must be a JVM
> bug) where we have a Scorer.docid() method like this:
>
>   if (curDocIdx >= topDocs.scoreDocs.length) {
>      return NO_MORE_DOCS;
>    }
>    return topDocs.scoreDocs[curDocIdx].doc;
>
> And this was very rarely, not reproducibly, but repeatedly raising
> ArrayIndexOutOfBoundsException!
>
> It made us notice that topDocs.scoreDocs is not final, which maybe
> would have prevented this. Is there any reason why we would not make
> this member final?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
> --
Mike McCandless

http://blog.mikemccandless.com