diff --git a/src/main/java/org/jboss/netty/buffer/CompositeChannelBuffer.java b/src/main/java/org/jboss/netty/buffer/CompositeChannelBuffer.java index fb600609bc..9798df3752 100644 --- a/src/main/java/org/jboss/netty/buffer/CompositeChannelBuffer.java +++ b/src/main/java/org/jboss/netty/buffer/CompositeChannelBuffer.java @@ -78,7 +78,7 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer { } order = expectedEndianness; - setFromList(newComponents); + setComponents(newComponents); } /** @@ -131,7 +131,7 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer { /** * Setup this ChannelBuffer from the list */ - private void setFromList(List newComponents) { + private void setComponents(List newComponents) { assert !newComponents.isEmpty(); // Clear the cache. @@ -148,6 +148,10 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer { assert c.readerIndex() == 0; assert c.writerIndex() == c.capacity(); + if (c.writerIndex() != c.capacity()) { + System.err.println(c); + throw new Error(); + } components[i] = c; } @@ -689,7 +693,7 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer { // ignore } - setFromList(list); + setComponents(list); // reset marked Indexes localMarkedReaderIndex = Math.max(localMarkedReaderIndex - localReaderIndex, 0);