Fix a bug in MessageList.add(T[])

- where it uses incorrect source index while iteration
This commit is contained in:
Trustin Lee 2013-07-02 10:11:17 +09:00
parent 720de2e6cc
commit 26b56d3add

View File

@ -268,7 +268,7 @@ public final class MessageList<T> implements Iterable<T> {
try { try {
if (byteBufsOnly) { if (byteBufsOnly) {
while (i < srcEndIdx) { while (i < srcEndIdx) {
T m = src[srcIdx]; T m = src[i];
if (m == null) { if (m == null) {
throw new NullPointerException("src[" + srcIdx + ']'); throw new NullPointerException("src[" + srcIdx + ']');
} }
@ -284,7 +284,7 @@ public final class MessageList<T> implements Iterable<T> {
} }
for (; i < srcEndIdx; i ++) { for (; i < srcEndIdx; i ++) {
T m = src[srcIdx]; T m = src[i];
if (m == null) { if (m == null) {
throw new NullPointerException("src[" + srcIdx + ']'); throw new NullPointerException("src[" + srcIdx + ']');
} }