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

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/pforcodec_3892@1364083 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-07-21 13:30:42 +00:00
parent 6ccd856bae
commit 5d36bf73e1
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;
}