From d4665f1703241a4f0325348d0e3010520f5bbdaa Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 28 Jun 2013 21:14:23 +0900 Subject: [PATCH] Fix test failures --- transport/src/main/java/io/netty/channel/MessageList.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/MessageList.java b/transport/src/main/java/io/netty/channel/MessageList.java index 11a83ef25c..e63123d880 100644 --- a/transport/src/main/java/io/netty/channel/MessageList.java +++ b/transport/src/main/java/io/netty/channel/MessageList.java @@ -267,13 +267,14 @@ public final class MessageList implements Iterable { int i = srcIdx; try { if (byteBufsOnly) { - for (; i < srcEndIdx; i ++) { + while (i < srcEndIdx) { T m = src[srcIdx]; if (m == null) { throw new NullPointerException("src[" + srcIdx + ']'); } elements[dstIdx ++] = m; + i ++; if (!(m instanceof ByteBuf)) { byteBufsOnly = false; @@ -297,7 +298,7 @@ public final class MessageList implements Iterable { } } - assert dstIdx == newSize; + assert dstIdx == newSize : String.format("dstIdx(%d) != newSize(%d)", dstIdx, newSize); size = newSize; return this;