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

This commit is contained in:
David Smiley 2016-07-18 22:04:26 -04:00
parent 4123b3bf26
commit efef37bb67
2 changed files with 7 additions and 5 deletions

View File

@ -131,6 +131,8 @@ Optimizations
* LUCENE-7371: Point values are now better compressed using run-length
encoding. (Adrien Grand)
* LUCENE-7385: Improve/fix assert messages in SpanScorer. (David Smiley)
Other
* LUCENE-4787: Fixed some highlighting javadocs. (Michael Dodsworth via Adrien

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;
}
/**