LUCENE-3892: fix SimpleText reuse bug w/ start/endOffset

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1364714 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-07-23 17:10:59 +00:00
parent 163a5a1c0e
commit ed85646812
1 changed files with 6 additions and 2 deletions

View File

@ -343,8 +343,8 @@ class SimpleTextFieldsReader extends FieldsProducer {
private long nextDocStart;
private boolean readOffsets;
private boolean readPositions;
private int startOffset = -1;
private int endOffset = -1;
private int startOffset;
private int endOffset;
public SimpleTextDocsAndPositionsEnum() {
this.inStart = SimpleTextFieldsReader.this.in;
@ -361,6 +361,10 @@ class SimpleTextFieldsReader extends FieldsProducer {
docID = -1;
readPositions = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0;
readOffsets = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
if (!readOffsets) {
startOffset = -1;
endOffset = -1;
}
return this;
}