Skip to content

Commit

Permalink
added more asserts to BLOBHeap.flushBuffer() to fix the problem descr…
Browse files Browse the repository at this point in the history
  • Loading branch information
orbiter committed Mar 3, 2009
1 parent c545fcb commit d4b56d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/de/anomic/kelondro/blob/BLOBHeap.java
Expand Up @@ -170,8 +170,11 @@ private void flushBuffer() throws IOException {
index.putl(key, posFile);
b = AbstractRandomAccess.int2array(key.length + blob.length);
assert b.length == 4;
assert posBuffer + 4 < ba.length : "posBuffer = " + posBuffer + ", ba.length = " + ba.length;
System.arraycopy(b, 0, ba, posBuffer, 4);
assert posBuffer + 4 + key.length <= ba.length : "posBuffer = " + posBuffer + ", key.length = " + key.length + ", ba.length = " + ba.length;
System.arraycopy(key, 0, ba, posBuffer + 4, key.length);
assert posBuffer + 4 + key.length + blob.length <= ba.length : "posBuffer = " + posBuffer + ", key.length = " + key.length + ", blob.length = " + blob.length + ", ba.length = " + ba.length;
System.arraycopy(blob, 0, ba, posBuffer + 4 + key.length, blob.length);
posFile += 4 + key.length + blob.length;
posBuffer += 4 + key.length + blob.length;
Expand Down

0 comments on commit d4b56d5

Please sign in to comment.