Fix offset array assertion off-by-one

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1236912 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2012-01-27 22:43:48 +00:00
parent f6e22fd4fa
commit 97d62cc383
1 changed files with 2 additions and 2 deletions

View File

@ -95,9 +95,9 @@ public abstract class BaseCharFilter extends CharFilter {
diffs = ArrayUtil.grow(diffs);
}
assert (size == 0 || off >= offsets[size])
assert (size == 0 || off >= offsets[size - 1])
: "Offset #" + size + "(" + off + ") is less than the last recorded offset "
+ offsets[size] + "\n" + Arrays.toString(offsets) + "\n" + Arrays.toString(diffs);
+ offsets[size - 1] + "\n" + Arrays.toString(offsets) + "\n" + Arrays.toString(diffs);
if (size == 0 || off != offsets[size - 1]) {
offsets[size] = off;