From b86d3d692aa1a5417c2890f3fef78cc2dcfa6577 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 14 Mar 2013 06:58:14 +0900 Subject: [PATCH] Fix a bug where AbstractByteBuf.order() doesn't return a swapped buffer if capacity is 0. - Fixes #1152 --- buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java b/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java index d9799d5eda..0828ab1e0b 100644 --- a/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java @@ -331,7 +331,7 @@ public abstract class AbstractByteBuf implements ByteBuf { if (endianness == null) { throw new NullPointerException("endianness"); } - if (endianness == order() || capacity() == 0) { + if (endianness == order()) { return this; }