diff --git a/transport/src/main/java/io/netty/channel/MessageList.java b/transport/src/main/java/io/netty/channel/MessageList.java index e63123d880..5a393ac897 100644 --- a/transport/src/main/java/io/netty/channel/MessageList.java +++ b/transport/src/main/java/io/netty/channel/MessageList.java @@ -203,7 +203,7 @@ public final class MessageList implements Iterable { * no message stored in the given index. */ public T get(int index) { - checkExclusive(index); + checkIndex(index); return elements[index]; } @@ -211,7 +211,7 @@ public final class MessageList implements Iterable { * Sets the message on the given index. */ public MessageList set(int index, T value) { - checkExclusive(index); + checkIndex(index); if (value == null) { throw new NullPointerException("value"); } @@ -529,7 +529,7 @@ public final class MessageList implements Iterable { return (T[]) new Object[initialCapacity]; } - private void checkExclusive(int index) { + private void checkIndex(int index) { if (index >= size) { throw new IndexOutOfBoundsException(String.valueOf(index)); }