Fix a bug where AbstractByteBuf.order() doesn't return a swapped buffer if capacity is 0.

- Fixes #1152
This commit is contained in:
Trustin Lee 2013-03-14 06:58:14 +09:00
parent 644d5abbda
commit b86d3d692a

View File

@ -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;
}