Remove methods overridden but identical with the super implementation / Make constructors of abstract classes protected rather than non-sense public

AbstractWrappedByteBuf.capacity(int) should raise a UnsupportedOperationException rather than ReadOnlyBufferException.
This commit is contained in:
Trustin Lee 2012-11-10 07:10:30 +09:00
parent ac53b9e99e
commit ab02e90684
9 changed files with 22 additions and 22 deletions

View File

@ -38,7 +38,7 @@ public abstract class HeapChannelBuffer extends AbstractChannelBuffer {
* *
* @param length the length of the new byte array * @param length the length of the new byte array
*/ */
public HeapChannelBuffer(int length) { protected HeapChannelBuffer(int length) {
this(new byte[length], 0, 0); this(new byte[length], 0, 0);
} }
@ -47,7 +47,7 @@ public abstract class HeapChannelBuffer extends AbstractChannelBuffer {
* *
* @param array the byte array to wrap * @param array the byte array to wrap
*/ */
public HeapChannelBuffer(byte[] array) { protected HeapChannelBuffer(byte[] array) {
this(array, 0, array.length); this(array, 0, array.length);
} }

View File

@ -46,7 +46,7 @@ abstract class AbstractOioWorker<C extends AbstractOioChannel> implements Worker
private volatile boolean done; private volatile boolean done;
public AbstractOioWorker(C channel) { protected AbstractOioWorker(C channel) {
this.channel = channel; this.channel = channel;
channel.worker = this; channel.worker = this;
} }

View File

@ -37,7 +37,7 @@ public abstract class AbstractDiskHttpData extends AbstractHttpData {
private boolean isRenamed; private boolean isRenamed;
private FileChannel fileChannel; private FileChannel fileChannel;
public AbstractDiskHttpData(String name, Charset charset, long size) { protected AbstractDiskHttpData(String name, Charset charset, long size) {
super(name, charset, size); super(name, charset, size);
} }

View File

@ -30,7 +30,7 @@ public abstract class AbstractHttpData implements HttpData {
protected Charset charset = HttpConstants.DEFAULT_CHARSET; protected Charset charset = HttpConstants.DEFAULT_CHARSET;
protected boolean completed; protected boolean completed;
public AbstractHttpData(String name, Charset charset, long size) { protected AbstractHttpData(String name, Charset charset, long size) {
if (name == null) { if (name == null) {
throw new NullPointerException("name"); throw new NullPointerException("name");
} }

View File

@ -37,7 +37,7 @@ public abstract class AbstractMemoryHttpData extends AbstractHttpData {
private int chunkPosition; private int chunkPosition;
protected boolean isRenamed; protected boolean isRenamed;
public AbstractMemoryHttpData(String name, Charset charset, long size) { protected AbstractMemoryHttpData(String name, Charset charset, long size) {
super(name, charset, size); super(name, charset, size);
} }

View File

@ -54,8 +54,8 @@ public abstract class WebSocketClientHandshaker {
* @param customHeaders * @param customHeaders
* Map of custom headers to add to the client request * Map of custom headers to add to the client request
*/ */
public WebSocketClientHandshaker(URI webSocketUrl, WebSocketVersion version, String subprotocol, protected WebSocketClientHandshaker(URI webSocketUrl, WebSocketVersion version, String subprotocol,
Map<String, String> customHeaders) { Map<String, String> customHeaders) {
this(webSocketUrl, version, subprotocol, customHeaders, Long.MAX_VALUE); this(webSocketUrl, version, subprotocol, customHeaders, Long.MAX_VALUE);
} }
@ -74,8 +74,8 @@ public abstract class WebSocketClientHandshaker {
* @param maxFramePayloadLength * @param maxFramePayloadLength
* Maximum length of a frame's payload * Maximum length of a frame's payload
*/ */
public WebSocketClientHandshaker(URI webSocketUrl, WebSocketVersion version, String subprotocol, protected WebSocketClientHandshaker(URI webSocketUrl, WebSocketVersion version, String subprotocol,
Map<String, String> customHeaders, long maxFramePayloadLength) { Map<String, String> customHeaders, long maxFramePayloadLength) {
this.webSocketUrl = webSocketUrl; this.webSocketUrl = webSocketUrl;
this.version = version; this.version = version;
expectedSubprotocol = subprotocol; expectedSubprotocol = subprotocol;

View File

@ -47,7 +47,7 @@ public abstract class SpdyOrHttpChooser implements ChannelUpstreamHandler {
private final int maxSpdyContentLength; private final int maxSpdyContentLength;
private final int maxHttpContentLength; private final int maxHttpContentLength;
public SpdyOrHttpChooser(int maxSpdyContentLength, int maxHttpContentLength) { protected SpdyOrHttpChooser(int maxSpdyContentLength, int maxHttpContentLength) {
this.maxSpdyContentLength = maxSpdyContentLength; this.maxSpdyContentLength = maxSpdyContentLength;
this.maxHttpContentLength = maxHttpContentLength; this.maxHttpContentLength = maxHttpContentLength;
} }

View File

@ -38,7 +38,7 @@ public abstract class ChannelEventRunnable implements Runnable, EstimatableObjec
* Creates a {@link Runnable} which sends the specified {@link ChannelEvent} * Creates a {@link Runnable} which sends the specified {@link ChannelEvent}
* upstream via the specified {@link ChannelHandlerContext}. * upstream via the specified {@link ChannelHandlerContext}.
*/ */
public ChannelEventRunnable(ChannelHandlerContext ctx, ChannelEvent e, Executor executor) { protected ChannelEventRunnable(ChannelHandlerContext ctx, ChannelEvent e, Executor executor) {
this.ctx = ctx; this.ctx = ctx;
this.e = e; this.e = e;
this.executor = executor; this.executor = executor;

View File

@ -148,8 +148,8 @@ public abstract class AbstractTrafficShapingHandler extends
* The delay between two computations of performances for * The delay between two computations of performances for
* channels or 0 if no stats are to be computed * channels or 0 if no stats are to be computed
*/ */
public AbstractTrafficShapingHandler(Timer timer, long writeLimit, protected AbstractTrafficShapingHandler(Timer timer, long writeLimit,
long readLimit, long checkInterval) { long readLimit, long checkInterval) {
init(new DefaultObjectSizeEstimator(), timer, writeLimit, readLimit, checkInterval); init(new DefaultObjectSizeEstimator(), timer, writeLimit, readLimit, checkInterval);
} }
@ -169,7 +169,7 @@ public abstract class AbstractTrafficShapingHandler extends
* The delay between two computations of performances for * The delay between two computations of performances for
* channels or 0 if no stats are to be computed * channels or 0 if no stats are to be computed
*/ */
public AbstractTrafficShapingHandler( protected AbstractTrafficShapingHandler(
ObjectSizeEstimator objectSizeEstimator, Timer timer, ObjectSizeEstimator objectSizeEstimator, Timer timer,
long writeLimit, long readLimit, long checkInterval) { long writeLimit, long readLimit, long checkInterval) {
init(objectSizeEstimator, timer, writeLimit, readLimit, checkInterval); init(objectSizeEstimator, timer, writeLimit, readLimit, checkInterval);
@ -185,8 +185,8 @@ public abstract class AbstractTrafficShapingHandler extends
* @param readLimit * @param readLimit
* 0 or a limit in bytes/s * 0 or a limit in bytes/s
*/ */
public AbstractTrafficShapingHandler(Timer timer, long writeLimit, protected AbstractTrafficShapingHandler(Timer timer, long writeLimit,
long readLimit) { long readLimit) {
init(new DefaultObjectSizeEstimator(), timer, writeLimit, readLimit, DEFAULT_CHECK_INTERVAL); init(new DefaultObjectSizeEstimator(), timer, writeLimit, readLimit, DEFAULT_CHECK_INTERVAL);
} }
@ -203,7 +203,7 @@ public abstract class AbstractTrafficShapingHandler extends
* @param readLimit * @param readLimit
* 0 or a limit in bytes/s * 0 or a limit in bytes/s
*/ */
public AbstractTrafficShapingHandler( protected AbstractTrafficShapingHandler(
ObjectSizeEstimator objectSizeEstimator, Timer timer, ObjectSizeEstimator objectSizeEstimator, Timer timer,
long writeLimit, long readLimit) { long writeLimit, long readLimit) {
init(objectSizeEstimator, timer, writeLimit, readLimit, DEFAULT_CHECK_INTERVAL); init(objectSizeEstimator, timer, writeLimit, readLimit, DEFAULT_CHECK_INTERVAL);
@ -215,7 +215,7 @@ public abstract class AbstractTrafficShapingHandler extends
* @param timer * @param timer
* created once for instance like HashedWheelTimer(10, TimeUnit.MILLISECONDS, 1024) * created once for instance like HashedWheelTimer(10, TimeUnit.MILLISECONDS, 1024)
*/ */
public AbstractTrafficShapingHandler(Timer timer) { protected AbstractTrafficShapingHandler(Timer timer) {
init(new DefaultObjectSizeEstimator(), timer, 0, 0, DEFAULT_CHECK_INTERVAL); init(new DefaultObjectSizeEstimator(), timer, 0, 0, DEFAULT_CHECK_INTERVAL);
} }
@ -228,7 +228,7 @@ public abstract class AbstractTrafficShapingHandler extends
* @param timer * @param timer
* created once for instance like HashedWheelTimer(10, TimeUnit.MILLISECONDS, 1024) * created once for instance like HashedWheelTimer(10, TimeUnit.MILLISECONDS, 1024)
*/ */
public AbstractTrafficShapingHandler( protected AbstractTrafficShapingHandler(
ObjectSizeEstimator objectSizeEstimator, Timer timer) { ObjectSizeEstimator objectSizeEstimator, Timer timer) {
init(objectSizeEstimator, timer, 0, 0, DEFAULT_CHECK_INTERVAL); init(objectSizeEstimator, timer, 0, 0, DEFAULT_CHECK_INTERVAL);
} }
@ -242,7 +242,7 @@ public abstract class AbstractTrafficShapingHandler extends
* The delay between two computations of performances for * The delay between two computations of performances for
* channels or 0 if no stats are to be computed * channels or 0 if no stats are to be computed
*/ */
public AbstractTrafficShapingHandler(Timer timer, long checkInterval) { protected AbstractTrafficShapingHandler(Timer timer, long checkInterval) {
init(new DefaultObjectSizeEstimator(), timer, 0, 0, checkInterval); init(new DefaultObjectSizeEstimator(), timer, 0, 0, checkInterval);
} }
@ -258,7 +258,7 @@ public abstract class AbstractTrafficShapingHandler extends
* The delay between two computations of performances for * The delay between two computations of performances for
* channels or 0 if no stats are to be computed * channels or 0 if no stats are to be computed
*/ */
public AbstractTrafficShapingHandler( protected AbstractTrafficShapingHandler(
ObjectSizeEstimator objectSizeEstimator, Timer timer, ObjectSizeEstimator objectSizeEstimator, Timer timer,
long checkInterval) { long checkInterval) {
init(objectSizeEstimator, timer, 0, 0, checkInterval); init(objectSizeEstimator, timer, 0, 0, checkInterval);