Skip to content

TermOrdsIterator#lookup throws ArrayIndexOutOfBoundsException [LUCENE-3377] #4450

@asfimport

Description

@asfimport

TermOrdsIterator's lookup method can throw an ArrayIndexOutOfBoundsException if reuse argument is reused acros segments.

Example collector:

private DocTermOrds.TermOrdsIterator reuse = null;

public void collect(int doc) throws IOException {
    ...
    reuse = docTermOrds.lookup(doc, reuse);
    ...
}

public void setNextReader(IndexReader.AtomicReaderContext context) throws IOException {
    docTermOrds = FieldCache.DEFAULT.getDocTermOrds(context.reader, field);
    ....
}

If reuse argument is always null exception doesn't occur.


Migrated from LUCENE-3377 by Martijn van Groningen (@martijnvg), updated Aug 17 2011

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions