Menu

#26 Unecessary null check in BufferConsumer.append()

open
nobody
None
5
2009-11-18
2009-11-18
Anonymous
No

null check in append() is not necessary since allocate() never returns null.

protected void append(byte[] array, int off, int len) throws IOException {
Buffer buffer = allocate();
//if(buffer != null) {
buffer.append(array, off, len);
//}
}

protected Buffer allocate() throws IOException {
return new ArrayBuffer();
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB