[#1626] Use static fields for default values

This commit is contained in:
Norman Maurer 2013-07-22 06:47:29 +02:00
parent fa4e15e198
commit feb8d101bd

View File

@ -22,6 +22,8 @@ import io.netty.util.internal.PlatformDependent;
* Skeltal {@link ByteBufAllocator} implementation to extend.
*/
public abstract class AbstractByteBufAllocator implements ByteBufAllocator {
private static final int DEFAULT_INITIAL_CAPACITY = 256;
private static final int DEFAULT_MAX_COMPONENTS = 16;
private final boolean directByDefault;
private final ByteBuf emptyBuf;
@ -94,7 +96,7 @@ public abstract class AbstractByteBufAllocator implements ByteBufAllocator {
@Override
public ByteBuf heapBuffer() {
return heapBuffer(256, Integer.MAX_VALUE);
return heapBuffer(DEFAULT_INITIAL_CAPACITY, Integer.MAX_VALUE);
}
@Override
@ -113,7 +115,7 @@ public abstract class AbstractByteBufAllocator implements ByteBufAllocator {
@Override
public ByteBuf directBuffer() {
return directBuffer(256, Integer.MAX_VALUE);
return directBuffer(DEFAULT_INITIAL_CAPACITY, Integer.MAX_VALUE);
}
@Override
@ -148,7 +150,7 @@ public abstract class AbstractByteBufAllocator implements ByteBufAllocator {
@Override
public CompositeByteBuf compositeHeapBuffer() {
return compositeHeapBuffer(16);
return compositeHeapBuffer(DEFAULT_MAX_COMPONENTS);
}
@Override
@ -158,7 +160,7 @@ public abstract class AbstractByteBufAllocator implements ByteBufAllocator {
@Override
public CompositeByteBuf compositeDirectBuffer() {
return compositeDirectBuffer(16);
return compositeDirectBuffer(DEFAULT_MAX_COMPONENTS);
}
@Override