mirror of https://github.com/apache/lucene.git
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:
parent
f6e22fd4fa
commit
97d62cc383
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue