LUCENE-7385: Improve/fix assert messages in SpanScorer.

(cherry picked from commit efef37b)
This commit is contained in:
David Smiley 2016-07-18 22:09:37 -04:00
parent 9bde118c2f
commit 6e99ed3013
2 changed files with 7 additions and 5 deletions

View File

@ -95,6 +95,8 @@ Improvements
* LUCENE-7376: Add support for ToParentBlockJoinQuery to fast vector highlighter's
FieldQuery. (Martijn van Groningen)
* LUCENE-7385: Improve/fix assert messages in SpanScorer. (David Smiley)
Optimizations
* LUCENE-7330, LUCENE-7339: Speed up conjunction queries. (Adrien Grand)

View File

@ -87,13 +87,13 @@ public class SpanScorer extends Scorer {
spans.doStartCurrentDoc();
assert spans.startPosition() == -1 : "incorrect initial start position, " + this.toString();
assert spans.endPosition() == -1 : "incorrect initial end position, " + this.toString();
assert spans.startPosition() == -1 : "incorrect initial start position, " + spans;
assert spans.endPosition() == -1 : "incorrect initial end position, " + spans;
int prevStartPos = -1;
int prevEndPos = -1;
int startPos = spans.nextStartPosition();
assert startPos != Spans.NO_MORE_POSITIONS : "initial startPos NO_MORE_POSITIONS, " + this.toString();
assert startPos != Spans.NO_MORE_POSITIONS : "initial startPos NO_MORE_POSITIONS, " + spans;
do {
assert startPos >= prevStartPos;
int endPos = spans.endPosition();
@ -113,8 +113,8 @@ public class SpanScorer extends Scorer {
startPos = spans.nextStartPosition();
} while (startPos != Spans.NO_MORE_POSITIONS);
assert spans.startPosition() == Spans.NO_MORE_POSITIONS : "incorrect final start position, " + this.toString();
assert spans.endPosition() == Spans.NO_MORE_POSITIONS : "incorrect final end position, " + this.toString();
assert spans.startPosition() == Spans.NO_MORE_POSITIONS : "incorrect final start position, " + spans;
assert spans.endPosition() == Spans.NO_MORE_POSITIONS : "incorrect final end position, " + spans;
}
/**