add defensive asserts

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1686404 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-06-19 13:09:12 +00:00
parent 982a965832
commit 954957c987
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,8 @@ class BytesStore extends DataOutput implements Accountable {
while (len > 0) {
int chunk = blockSize - nextWrite;
if (len <= chunk) {
assert b != null;
assert current != null;
System.arraycopy(b, offset, current, nextWrite, len);
nextWrite += len;
break;