diff --git a/src/main/java/org/jboss/netty/channel/local/DefaultLocalChannel.java b/src/main/java/org/jboss/netty/channel/local/DefaultLocalChannel.java index 455d43a578..2e941fba8d 100644 --- a/src/main/java/org/jboss/netty/channel/local/DefaultLocalChannel.java +++ b/src/main/java/org/jboss/netty/channel/local/DefaultLocalChannel.java @@ -104,7 +104,7 @@ final class DefaultLocalChannel extends AbstractChannel implements LocalChannel return state.get() == ST_CONNECTED; } - final void setBound() throws ClosedChannelException { + void setBound() throws ClosedChannelException { if (!state.compareAndSet(ST_OPEN, ST_BOUND)) { switch (state.get()) { case ST_CLOSED: @@ -115,7 +115,7 @@ final class DefaultLocalChannel extends AbstractChannel implements LocalChannel } } - final void setConnected() { + void setConnected() { if (state.get() != ST_CLOSED) { state.set(ST_CONNECTED); } diff --git a/src/main/java/org/jboss/netty/channel/rxtx/RXTXChannelConfig.java b/src/main/java/org/jboss/netty/channel/rxtx/RXTXChannelConfig.java index 6efe0c5e8f..a787b543e3 100644 --- a/src/main/java/org/jboss/netty/channel/rxtx/RXTXChannelConfig.java +++ b/src/main/java/org/jboss/netty/channel/rxtx/RXTXChannelConfig.java @@ -28,7 +28,7 @@ import org.jboss.netty.util.internal.ConversionUtil; */ public class RXTXChannelConfig extends DefaultChannelConfig { - public static enum Stopbits { + public enum Stopbits { STOPBITS_1(SerialPort.STOPBITS_1), STOPBITS_2(SerialPort.STOPBITS_2), @@ -36,7 +36,7 @@ public class RXTXChannelConfig extends DefaultChannelConfig { private final int value; - private Stopbits(int value) { + Stopbits(int value) { this.value = value; } @@ -54,7 +54,7 @@ public class RXTXChannelConfig extends DefaultChannelConfig { } } - public static enum Databits { + public enum Databits { DATABITS_5(SerialPort.DATABITS_5), DATABITS_6(SerialPort.DATABITS_6), @@ -63,7 +63,7 @@ public class RXTXChannelConfig extends DefaultChannelConfig { private final int value; - private Databits(int value) { + Databits(int value) { this.value = value; } @@ -81,7 +81,7 @@ public class RXTXChannelConfig extends DefaultChannelConfig { } } - public static enum Paritybit { + public enum Paritybit { NONE(SerialPort.PARITY_NONE), ODD(SerialPort.PARITY_ODD), @@ -91,7 +91,7 @@ public class RXTXChannelConfig extends DefaultChannelConfig { private final int value; - private Paritybit(int value) { + Paritybit(int value) { this.value = value; } diff --git a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelClientChannel.java b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelClientChannel.java index 7e17e4798c..c2573e03df 100644 --- a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelClientChannel.java +++ b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelClientChannel.java @@ -288,7 +288,7 @@ public class HttpTunnelClientChannel extends AbstractChannel implements Channels.fireChannelInterestChanged(this); } - private class ConsolidatingFutureListener implements ChannelFutureListener { + private static class ConsolidatingFutureListener implements ChannelFutureListener { private final ChannelFuture completionFuture; diff --git a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelServerChannelSink.java b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelServerChannelSink.java index 95d5853f13..aad8dcfc56 100644 --- a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelServerChannelSink.java +++ b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelServerChannelSink.java @@ -61,7 +61,7 @@ class HttpTunnelServerChannelSink extends AbstractChannelSink { } } - private final class ChannelFutureProxy implements ChannelFutureListener { + private static final class ChannelFutureProxy implements ChannelFutureListener { private final ChannelFuture upstreamFuture; ChannelFutureProxy(ChannelFuture upstreamFuture) { diff --git a/src/main/java/org/jboss/netty/channel/socket/http/ServerMessageSwitch.java b/src/main/java/org/jboss/netty/channel/socket/http/ServerMessageSwitch.java index ee2938b3a6..64cf9cbe08 100644 --- a/src/main/java/org/jboss/netty/channel/socket/http/ServerMessageSwitch.java +++ b/src/main/java/org/jboss/netty/channel/socket/http/ServerMessageSwitch.java @@ -238,7 +238,7 @@ class ServerMessageSwitch implements ServerMessageSwitchUpstreamInterface, /** * Used to pass the result received from one ChannelFutureListener to another verbatim. */ - private final class RelayedChannelFutureListener implements + private static final class RelayedChannelFutureListener implements ChannelFutureListener { private final ChannelFuture originalFuture; diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/SocketReceiveBufferPool.java b/src/main/java/org/jboss/netty/channel/socket/nio/SocketReceiveBufferPool.java index 321f4cc69f..c0922ef314 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/SocketReceiveBufferPool.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/SocketReceiveBufferPool.java @@ -30,7 +30,7 @@ final class SocketReceiveBufferPool { @SuppressWarnings("unchecked") private final SoftReference[] pool = new SoftReference[POOL_SIZE]; - final ByteBuffer acquire(int size) { + ByteBuffer acquire(int size) { final SoftReference[] pool = this.pool; for (int i = 0; i < POOL_SIZE; i ++) { SoftReference ref = pool[i]; @@ -59,7 +59,7 @@ final class SocketReceiveBufferPool { return buf; } - final void release(ByteBuffer buffer) { + void release(ByteBuffer buffer) { final SoftReference[] pool = this.pool; for (int i = 0; i < POOL_SIZE; i ++) { SoftReference ref = pool[i]; @@ -95,4 +95,4 @@ final class SocketReceiveBufferPool { } return q << 10; } -} \ No newline at end of file +} diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/SocketSendBufferPool.java b/src/main/java/org/jboss/netty/channel/socket/nio/SocketSendBufferPool.java index ac1d4e742c..237d52451c 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/SocketSendBufferPool.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/SocketSendBufferPool.java @@ -45,7 +45,7 @@ final class SocketSendBufferPool { super(); } - final SendBuffer acquire(Object message) { + SendBuffer acquire(Object message) { if (message instanceof ChannelBuffer) { return acquire((ChannelBuffer) message); } else if (message instanceof FileRegion) { @@ -147,7 +147,7 @@ final class SocketSendBufferPool { return q << ALIGN_SHIFT; } - private final class Preallocation { + private static final class Preallocation { final ByteBuffer buffer; int refCnt; @@ -176,7 +176,7 @@ final class SocketSendBufferPool { void release(); } - class UnpooledSendBuffer implements SendBuffer { + static class UnpooledSendBuffer implements SendBuffer { final ByteBuffer buffer; final int initialPos; @@ -266,7 +266,7 @@ final class SocketSendBufferPool { } } - final class FileSendBuffer implements SendBuffer { + static final class FileSendBuffer implements SendBuffer { private final FileRegion file; private long writtenBytes; @@ -320,27 +320,27 @@ final class SocketSendBufferPool { } @Override - public final boolean finished() { + public boolean finished() { return true; } @Override - public final long writtenBytes() { + public long writtenBytes() { return 0; } @Override - public final long totalBytes() { + public long totalBytes() { return 0; } @Override - public final long transferTo(WritableByteChannel ch) throws IOException { + public long transferTo(WritableByteChannel ch) throws IOException { return 0; } @Override - public final long transferTo(DatagramChannel ch, SocketAddress raddr) throws IOException { + public long transferTo(DatagramChannel ch, SocketAddress raddr) throws IOException { return 0; } diff --git a/src/main/java/org/jboss/netty/example/http/websocketx/client/WebSocketClientFactory.java b/src/main/java/org/jboss/netty/example/http/websocketx/client/WebSocketClientFactory.java index 745c6eddcb..253d7dbe2f 100644 --- a/src/main/java/org/jboss/netty/example/http/websocketx/client/WebSocketClientFactory.java +++ b/src/main/java/org/jboss/netty/example/http/websocketx/client/WebSocketClientFactory.java @@ -72,6 +72,7 @@ public class WebSocketClientFactory { bootstrap.setPipelineFactory(new ChannelPipelineFactory() { + @Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("decoder", new WebSocketHttpResponseDecoder()); diff --git a/src/main/java/org/jboss/netty/example/http/websocketx/client/WebSocketClientHandler.java b/src/main/java/org/jboss/netty/example/http/websocketx/client/WebSocketClientHandler.java index 28aff75bb8..58725d3ece 100644 --- a/src/main/java/org/jboss/netty/example/http/websocketx/client/WebSocketClientHandler.java +++ b/src/main/java/org/jboss/netty/example/http/websocketx/client/WebSocketClientHandler.java @@ -102,14 +102,17 @@ public class WebSocketClientHandler extends SimpleChannelUpstreamHandler impleme e.getChannel().close(); } + @Override public ChannelFuture connect() { return bootstrap.connect(new InetSocketAddress(url.getHost(), url.getPort())); } + @Override public ChannelFuture disconnect() { return channel.close(); } + @Override public ChannelFuture send(WebSocketFrame frame) { return channel.write(frame); } diff --git a/src/main/java/org/jboss/netty/example/iostream/IOStream.java b/src/main/java/org/jboss/netty/example/iostream/IOStream.java index 1abc192d2c..66690c0e6b 100755 --- a/src/main/java/org/jboss/netty/example/iostream/IOStream.java +++ b/src/main/java/org/jboss/netty/example/iostream/IOStream.java @@ -44,6 +44,7 @@ public class IOStream { // Configure the event pipeline factory. bootstrap.setPipelineFactory(new ChannelPipelineFactory() { + @Override public ChannelPipeline getPipeline() throws Exception { DefaultChannelPipeline pipeline = new DefaultChannelPipeline(); pipeline.addLast("framer", new DelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter())); diff --git a/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java b/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java index 03af00127c..7946fef1a8 100644 --- a/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java +++ b/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java @@ -25,6 +25,7 @@ public final class LocalTimeProtocol { ; + @Override public final int getNumber() { return value; } public static Continent valueOf(int value) { @@ -51,20 +52,23 @@ public final class LocalTimeProtocol { private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + @Override public Continent findValueByNumber(int number) { return Continent.valueOf(number) ; } }; + @Override public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); } + @Override public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.getDescriptor().getEnumTypes().get(0); } @@ -82,7 +86,7 @@ public final class LocalTimeProtocol { } private final int index; private final int value; - private Continent(int index, int value) { + Continent(int index, int value) { this.index = index; this.value = value; } @@ -106,6 +110,7 @@ public final class LocalTimeProtocol { ; + @Override public final int getNumber() { return value; } public static DayOfWeek valueOf(int value) { @@ -128,20 +133,23 @@ public final class LocalTimeProtocol { private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + @Override public DayOfWeek findValueByNumber(int number) { return DayOfWeek.valueOf(number) ; } }; + @Override public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); } + @Override public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.getDescriptor().getEnumTypes().get(1); } @@ -159,7 +167,7 @@ public final class LocalTimeProtocol { } private final int index; private final int value; - private DayOfWeek(int index, int value) { + DayOfWeek(int index, int value) { this.index = index; this.value = value; } @@ -184,15 +192,17 @@ public final class LocalTimeProtocol { return defaultInstance; } + @Override public Location getDefaultInstanceForType() { return defaultInstance; } - public static final com.google.protobuf.Descriptors.Descriptor + public static com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Location_descriptor; } + @Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Location_fieldAccessorTable; @@ -215,7 +225,8 @@ public final class LocalTimeProtocol { private void initFields() { continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; } - public final boolean isInitialized() { + @Override + public boolean isInitialized() { if (!hasContinent) { return false; } @@ -225,6 +236,7 @@ public final class LocalTimeProtocol { return true; } + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -238,6 +250,7 @@ public final class LocalTimeProtocol { } private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) { @@ -326,10 +339,12 @@ public final class LocalTimeProtocol { } public static Builder newBuilder() { return Builder.create(); } + @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.jboss.netty.example.localtime.LocalTimeProtocol.Location prototype) { return newBuilder().mergeFrom(prototype); } + @Override public Builder toBuilder() { return newBuilder(this); } public static final class Builder extends @@ -345,10 +360,12 @@ public final class LocalTimeProtocol { return builder; } + @Override protected org.jboss.netty.example.localtime.LocalTimeProtocol.Location internalGetResult() { return result; } + @Override public Builder clear() { if (result == null) { throw new IllegalStateException( @@ -358,22 +375,27 @@ public final class LocalTimeProtocol { return this; } + @Override public Builder clone() { return create().mergeFrom(result); } + @Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDescriptor(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.Location getDefaultInstanceForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDefaultInstance(); } + @Override public boolean isInitialized() { return result.isInitialized(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.Location build() { if (result != null && !isInitialized()) { throw newUninitializedMessageException(result); @@ -390,6 +412,7 @@ public final class LocalTimeProtocol { return buildPartial(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.Location buildPartial() { if (result == null) { throw new IllegalStateException( @@ -400,6 +423,7 @@ public final class LocalTimeProtocol { return returnMe; } + @Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.jboss.netty.example.localtime.LocalTimeProtocol.Location) { return mergeFrom((org.jboss.netty.example.localtime.LocalTimeProtocol.Location)other); @@ -423,6 +447,7 @@ public final class LocalTimeProtocol { return this; } + @Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -530,15 +555,17 @@ public final class LocalTimeProtocol { return defaultInstance; } + @Override public Locations getDefaultInstanceForType() { return defaultInstance; } - public static final com.google.protobuf.Descriptors.Descriptor + public static com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Locations_descriptor; } + @Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Locations_fieldAccessorTable; @@ -558,7 +585,8 @@ public final class LocalTimeProtocol { private void initFields() { } - public final boolean isInitialized() { + @Override + public boolean isInitialized() { for (org.jboss.netty.example.localtime.LocalTimeProtocol.Location element : getLocationList()) { if (!element.isInitialized()) { return false; @@ -567,6 +595,7 @@ public final class LocalTimeProtocol { return true; } + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -577,6 +606,7 @@ public final class LocalTimeProtocol { } private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) { @@ -661,10 +691,12 @@ public final class LocalTimeProtocol { } public static Builder newBuilder() { return Builder.create(); } + @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.jboss.netty.example.localtime.LocalTimeProtocol.Locations prototype) { return newBuilder().mergeFrom(prototype); } + @Override public Builder toBuilder() { return newBuilder(this); } public static final class Builder extends @@ -680,10 +712,12 @@ public final class LocalTimeProtocol { return builder; } + @Override protected org.jboss.netty.example.localtime.LocalTimeProtocol.Locations internalGetResult() { return result; } + @Override public Builder clear() { if (result == null) { throw new IllegalStateException( @@ -693,22 +727,27 @@ public final class LocalTimeProtocol { return this; } + @Override public Builder clone() { return create().mergeFrom(result); } + @Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.getDescriptor(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.Locations getDefaultInstanceForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.getDefaultInstance(); } + @Override public boolean isInitialized() { return result.isInitialized(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.Locations build() { if (result != null && !isInitialized()) { throw newUninitializedMessageException(result); @@ -725,6 +764,7 @@ public final class LocalTimeProtocol { return buildPartial(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.Locations buildPartial() { if (result == null) { throw new IllegalStateException( @@ -739,6 +779,7 @@ public final class LocalTimeProtocol { return returnMe; } + @Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.jboss.netty.example.localtime.LocalTimeProtocol.Locations) { return mergeFrom((org.jboss.netty.example.localtime.LocalTimeProtocol.Locations)other); @@ -762,6 +803,7 @@ public final class LocalTimeProtocol { return this; } + @Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -870,15 +912,17 @@ public final class LocalTimeProtocol { return defaultInstance; } + @Override public LocalTime getDefaultInstanceForType() { return defaultInstance; } - public static final com.google.protobuf.Descriptors.Descriptor + public static com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTime_descriptor; } + @Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTime_fieldAccessorTable; @@ -936,7 +980,8 @@ public final class LocalTimeProtocol { private void initFields() { dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY; } - public final boolean isInitialized() { + @Override + public boolean isInitialized() { if (!hasYear) { return false; } @@ -961,6 +1006,7 @@ public final class LocalTimeProtocol { return true; } + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -989,6 +1035,7 @@ public final class LocalTimeProtocol { } private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) { @@ -1097,10 +1144,12 @@ public final class LocalTimeProtocol { } public static Builder newBuilder() { return Builder.create(); } + @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime prototype) { return newBuilder().mergeFrom(prototype); } + @Override public Builder toBuilder() { return newBuilder(this); } public static final class Builder extends @@ -1116,10 +1165,12 @@ public final class LocalTimeProtocol { return builder; } + @Override protected org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime internalGetResult() { return result; } + @Override public Builder clear() { if (result == null) { throw new IllegalStateException( @@ -1129,22 +1180,27 @@ public final class LocalTimeProtocol { return this; } + @Override public Builder clone() { return create().mergeFrom(result); } + @Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDescriptor(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime getDefaultInstanceForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDefaultInstance(); } + @Override public boolean isInitialized() { return result.isInitialized(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime build() { if (result != null && !isInitialized()) { throw newUninitializedMessageException(result); @@ -1161,6 +1217,7 @@ public final class LocalTimeProtocol { return buildPartial(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime buildPartial() { if (result == null) { throw new IllegalStateException( @@ -1171,6 +1228,7 @@ public final class LocalTimeProtocol { return returnMe; } + @Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime) { return mergeFrom((org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime)other); @@ -1209,6 +1267,7 @@ public final class LocalTimeProtocol { return this; } + @Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1423,15 +1482,17 @@ public final class LocalTimeProtocol { return defaultInstance; } + @Override public LocalTimes getDefaultInstanceForType() { return defaultInstance; } - public static final com.google.protobuf.Descriptors.Descriptor + public static com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTimes_descriptor; } + @Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTimes_fieldAccessorTable; @@ -1451,7 +1512,8 @@ public final class LocalTimeProtocol { private void initFields() { } - public final boolean isInitialized() { + @Override + public boolean isInitialized() { for (org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime element : getLocalTimeList()) { if (!element.isInitialized()) { return false; @@ -1460,6 +1522,7 @@ public final class LocalTimeProtocol { return true; } + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -1470,6 +1533,7 @@ public final class LocalTimeProtocol { } private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) { @@ -1554,10 +1618,12 @@ public final class LocalTimeProtocol { } public static Builder newBuilder() { return Builder.create(); } + @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes prototype) { return newBuilder().mergeFrom(prototype); } + @Override public Builder toBuilder() { return newBuilder(this); } public static final class Builder extends @@ -1573,10 +1639,12 @@ public final class LocalTimeProtocol { return builder; } + @Override protected org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes internalGetResult() { return result; } + @Override public Builder clear() { if (result == null) { throw new IllegalStateException( @@ -1586,22 +1654,27 @@ public final class LocalTimeProtocol { return this; } + @Override public Builder clone() { return create().mergeFrom(result); } + @Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.getDescriptor(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes getDefaultInstanceForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.getDefaultInstance(); } + @Override public boolean isInitialized() { return result.isInitialized(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes build() { if (result != null && !isInitialized()) { throw newUninitializedMessageException(result); @@ -1618,6 +1691,7 @@ public final class LocalTimeProtocol { return buildPartial(); } + @Override public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes buildPartial() { if (result == null) { throw new IllegalStateException( @@ -1632,6 +1706,7 @@ public final class LocalTimeProtocol { return returnMe; } + @Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes) { return mergeFrom((org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes)other); @@ -1655,6 +1730,7 @@ public final class LocalTimeProtocol { return this; } + @Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1801,6 +1877,7 @@ public final class LocalTimeProtocol { }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + @Override public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; diff --git a/src/main/java/org/jboss/netty/handler/codec/base64/Base64Dialect.java b/src/main/java/org/jboss/netty/handler/codec/base64/Base64Dialect.java index d7e097442c..c49cea6593 100644 --- a/src/main/java/org/jboss/netty/handler/codec/base64/Base64Dialect.java +++ b/src/main/java/org/jboss/netty/handler/codec/base64/Base64Dialect.java @@ -203,7 +203,7 @@ public enum Base64Dialect { final byte[] decodabet; final boolean breakLinesByDefault; - private Base64Dialect(byte[] alphabet, byte[] decodabet, boolean breakLinesByDefault) { + Base64Dialect(byte[] alphabet, byte[] decodabet, boolean breakLinesByDefault) { this.alphabet = alphabet; this.decodabet = decodabet; this.breakLinesByDefault = breakLinesByDefault; diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpHeaderDateFormat.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpHeaderDateFormat.java index 421a33c07e..3a90733f31 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/HttpHeaderDateFormat.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpHeaderDateFormat.java @@ -67,7 +67,7 @@ final class HttpHeaderDateFormat extends SimpleDateFormat { * First obsolete format

* Sunday, 06-Nov-94 08:49:37 GMT -> E, d-MMM-y HH:mm:ss z */ - private final class HttpHeaderDateFormatObsolete1 extends SimpleDateFormat { + private static final class HttpHeaderDateFormatObsolete1 extends SimpleDateFormat { private static final long serialVersionUID = -3178072504225114298L; HttpHeaderDateFormatObsolete1() { @@ -81,7 +81,7 @@ final class HttpHeaderDateFormat extends SimpleDateFormat { *

* Sun Nov 6 08:49:37 1994 -> EEE, MMM d HH:mm:ss yyyy */ - private final class HttpHeaderDateFormatObsolete2 extends SimpleDateFormat { + private static final class HttpHeaderDateFormatObsolete2 extends SimpleDateFormat { private static final long serialVersionUID = 3010674519968303714L; HttpHeaderDateFormatObsolete2() { diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java index e2658ebafa..8ed7643337 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java @@ -124,7 +124,7 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder extends AbstractMap * @param hash the hash code for the key * @return the segment */ - final Segment segmentFor(int hash) { + Segment segmentFor(int hash) { return segments[hash >>> segmentShift & segmentMask]; } @@ -173,21 +173,21 @@ public final class ConcurrentHashMap extends AbstractMap } @SuppressWarnings("unchecked") - final K key() { + K key() { return (K) key; } @SuppressWarnings("unchecked") - final V value() { + V value() { return (V) value; } - final void setValue(V value) { + void setValue(V value) { this.value = value; } @SuppressWarnings("unchecked") - static final HashEntry[] newArray(int i) { + static HashEntry[] newArray(int i) { return new HashEntry[i]; } } @@ -273,7 +273,7 @@ public final class ConcurrentHashMap extends AbstractMap } @SuppressWarnings("unchecked") - static final Segment[] newArray(int i) { + static Segment[] newArray(int i) { return new Segment[i]; } diff --git a/src/main/java/org/jboss/netty/util/internal/ConcurrentIdentityHashMap.java b/src/main/java/org/jboss/netty/util/internal/ConcurrentIdentityHashMap.java index 9e06a05fee..7f82088dca 100644 --- a/src/main/java/org/jboss/netty/util/internal/ConcurrentIdentityHashMap.java +++ b/src/main/java/org/jboss/netty/util/internal/ConcurrentIdentityHashMap.java @@ -138,7 +138,7 @@ public final class ConcurrentIdentityHashMap extends AbstractMap * @param hash the hash code for the key * @return the segment */ - final Segment segmentFor(int hash) { + Segment segmentFor(int hash) { return segments[hash >>> segmentShift & segmentMask]; } @@ -173,21 +173,21 @@ public final class ConcurrentIdentityHashMap extends AbstractMap } @SuppressWarnings("unchecked") - final K key() { + K key() { return (K) key; } @SuppressWarnings("unchecked") - final V value() { + V value() { return (V) value; } - final void setValue(V value) { + void setValue(V value) { this.value = value; } @SuppressWarnings("unchecked") - static final HashEntry[] newArray(int i) { + static HashEntry[] newArray(int i) { return new HashEntry[i]; } } @@ -273,7 +273,7 @@ public final class ConcurrentIdentityHashMap extends AbstractMap } @SuppressWarnings("unchecked") - static final Segment[] newArray(int i) { + static Segment[] newArray(int i) { return new Segment[i]; } diff --git a/src/main/java/org/jboss/netty/util/internal/ConcurrentIdentityWeakKeyHashMap.java b/src/main/java/org/jboss/netty/util/internal/ConcurrentIdentityWeakKeyHashMap.java index 1c7f546cbb..4df097d353 100644 --- a/src/main/java/org/jboss/netty/util/internal/ConcurrentIdentityWeakKeyHashMap.java +++ b/src/main/java/org/jboss/netty/util/internal/ConcurrentIdentityWeakKeyHashMap.java @@ -145,7 +145,7 @@ public final class ConcurrentIdentityWeakKeyHashMap extends AbstractMap segmentFor(int hash) { + Segment segmentFor(int hash) { return segments[hash >>> segmentShift & segmentMask]; } @@ -167,11 +167,11 @@ public final class ConcurrentIdentityWeakKeyHashMap extends AbstractMap extends AbstractMap) keyRef).get(); } - final V value() { + V value() { return dereferenceValue(valueRef); } @SuppressWarnings("unchecked") - final V dereferenceValue(Object value) { + V dereferenceValue(Object value) { if (value instanceof WeakKeyReference) { return ((Reference) value).get(); } @@ -221,12 +221,12 @@ public final class ConcurrentIdentityWeakKeyHashMap extends AbstractMap HashEntry[] newArray(int i) { + static HashEntry[] newArray(int i) { return new HashEntry[i]; } } @@ -318,7 +318,7 @@ public final class ConcurrentIdentityWeakKeyHashMap extends AbstractMap Segment[] newArray(int i) { + static Segment[] newArray(int i) { return new Segment[i]; } @@ -618,7 +618,7 @@ public final class ConcurrentIdentityWeakKeyHashMap extends AbstractMap extends AbstractMap impl * @param hash the hash code for the key * @return the segment */ - final Segment segmentFor(int hash) { + Segment segmentFor(int hash) { return segments[hash >>> segmentShift & segmentMask]; } @@ -167,11 +167,11 @@ public final class ConcurrentWeakKeyHashMap extends AbstractMap impl this.hash = hash; } - public final int keyHash() { + public int keyHash() { return hash; } - public final Object keyRef() { + public Object keyRef() { return this; } } @@ -204,16 +204,16 @@ public final class ConcurrentWeakKeyHashMap extends AbstractMap impl } @SuppressWarnings("unchecked") - final K key() { + K key() { return ((WeakReference) keyRef).get(); } - final V value() { + V value() { return dereferenceValue(valueRef); } @SuppressWarnings("unchecked") - final V dereferenceValue(Object value) { + V dereferenceValue(Object value) { if (value instanceof WeakKeyReference) { return ((Reference) value).get(); } @@ -221,12 +221,12 @@ public final class ConcurrentWeakKeyHashMap extends AbstractMap impl return (V) value; } - final void setValue(V value) { + void setValue(V value) { this.valueRef = value; } @SuppressWarnings("unchecked") - static final HashEntry[] newArray(int i) { + static HashEntry[] newArray(int i) { return new HashEntry[i]; } } @@ -318,7 +318,7 @@ public final class ConcurrentWeakKeyHashMap extends AbstractMap impl } @SuppressWarnings("unchecked") - static final Segment[] newArray(int i) { + static Segment[] newArray(int i) { return new Segment[i]; } @@ -618,7 +618,7 @@ public final class ConcurrentWeakKeyHashMap extends AbstractMap impl } @SuppressWarnings("rawtypes") - final void removeStale() { + void removeStale() { WeakKeyReference ref; while ((ref = (WeakKeyReference) refQueue.poll()) != null) { remove(ref.keyRef(), ref.keyHash(), null, true); diff --git a/src/main/java/org/jboss/netty/util/internal/LinkedTransferQueue.java b/src/main/java/org/jboss/netty/util/internal/LinkedTransferQueue.java index 7ca6974c1a..41d645e420 100644 --- a/src/main/java/org/jboss/netty/util/internal/LinkedTransferQueue.java +++ b/src/main/java/org/jboss/netty/util/internal/LinkedTransferQueue.java @@ -437,7 +437,7 @@ public class LinkedTransferQueue extends AbstractQueue volatile Thread waiter; // null until waiting // CAS methods for fields - final boolean casNext(Node cmp, Node val) { + boolean casNext(Node cmp, Node val) { if (AtomicFieldUpdaterUtil.isAvailable()) { return nextUpdater.compareAndSet(this, cmp, val); } else { @@ -452,7 +452,7 @@ public class LinkedTransferQueue extends AbstractQueue } } - final boolean casItem(Object cmp, Object val) { + boolean casItem(Object cmp, Object val) { // assert cmp == null || cmp.getClass() != Node.class; if (AtomicFieldUpdaterUtil.isAvailable()) { return itemUpdater.compareAndSet(this, cmp, val); @@ -481,7 +481,7 @@ public class LinkedTransferQueue extends AbstractQueue * Links node to itself to avoid garbage retention. Called * only after CASing head field, so uses relaxed write. */ - final void forgetNext() { + void forgetNext() { this.next = this; } @@ -494,7 +494,7 @@ public class LinkedTransferQueue extends AbstractQueue * follows either CAS or return from park (if ever parked; * else we don't care). */ - final void forgetContents() { + void forgetContents() { this.item = this; this.waiter = null; } @@ -503,7 +503,7 @@ public class LinkedTransferQueue extends AbstractQueue * Returns true if this node has been matched, including the * case of artificial matches due to cancellation. */ - final boolean isMatched() { + boolean isMatched() { Object x = item; return x == this || x == null == isData; } @@ -511,7 +511,7 @@ public class LinkedTransferQueue extends AbstractQueue /** * Returns true if this is an unmatched request node. */ - final boolean isUnmatchedRequest() { + boolean isUnmatchedRequest() { return !isData && item == null; } @@ -520,7 +520,7 @@ public class LinkedTransferQueue extends AbstractQueue * appended to this node because this node is unmatched and * has opposite data mode. */ - final boolean cannotPrecede(boolean haveData) { + boolean cannotPrecede(boolean haveData) { boolean d = isData; Object x; return d != haveData && (x = item) != this && x != null == d; @@ -529,7 +529,7 @@ public class LinkedTransferQueue extends AbstractQueue /** * Tries to artificially match a data node -- used by remove. */ - final boolean tryMatchData() { + boolean tryMatchData() { // assert isData; Object x = item; if (x != null && x != this && casItem(x, null)) { @@ -895,12 +895,12 @@ public class LinkedTransferQueue extends AbstractQueue } @Override - public final boolean hasNext() { + public boolean hasNext() { return nextNode != null; } @Override - public final E next() { + public E next() { Node p = nextNode; if (p == null) { throw new NoSuchElementException(); @@ -911,7 +911,7 @@ public class LinkedTransferQueue extends AbstractQueue } @Override - public final void remove() { + public void remove() { Node p = lastRet; if (p == null) { throw new IllegalStateException(); diff --git a/src/main/java/org/jboss/netty/util/internal/NonReentrantLock.java b/src/main/java/org/jboss/netty/util/internal/NonReentrantLock.java index b6aeb02625..bc05add136 100644 --- a/src/main/java/org/jboss/netty/util/internal/NonReentrantLock.java +++ b/src/main/java/org/jboss/netty/util/internal/NonReentrantLock.java @@ -68,7 +68,7 @@ public final class NonReentrantLock extends AbstractQueuedSynchronizer } @Override - protected final boolean tryAcquire(int acquires) { + protected boolean tryAcquire(int acquires) { if (compareAndSetState(0, 1)) { owner = Thread.currentThread(); return true; @@ -77,7 +77,7 @@ public final class NonReentrantLock extends AbstractQueuedSynchronizer } @Override - protected final boolean tryRelease(int releases) { + protected boolean tryRelease(int releases) { if (Thread.currentThread() != owner) { throw new IllegalMonitorStateException(); } @@ -87,7 +87,7 @@ public final class NonReentrantLock extends AbstractQueuedSynchronizer } @Override - protected final boolean isHeldExclusively() { + protected boolean isHeldExclusively() { return getState() != 0 && owner == Thread.currentThread(); } } diff --git a/src/main/java/org/jboss/netty/util/internal/jzlib/JZlib.java b/src/main/java/org/jboss/netty/util/internal/jzlib/JZlib.java index 7ab37b65af..7e7704064e 100644 --- a/src/main/java/org/jboss/netty/util/internal/jzlib/JZlib.java +++ b/src/main/java/org/jboss/netty/util/internal/jzlib/JZlib.java @@ -103,7 +103,7 @@ public final class JZlib { // Bit length codes must not exceed MAX_BL_BITS bits static final int MAX_BL_BITS = 7; - static enum WrapperType { + enum WrapperType { NONE, ZLIB, GZIP, ZLIB_OR_NONE; } } diff --git a/src/test/java/org/jboss/netty/channel/socket/AbstractSocketEchoTest.java b/src/test/java/org/jboss/netty/channel/socket/AbstractSocketEchoTest.java index d3630750ee..da0040889f 100644 --- a/src/test/java/org/jboss/netty/channel/socket/AbstractSocketEchoTest.java +++ b/src/test/java/org/jboss/netty/channel/socket/AbstractSocketEchoTest.java @@ -147,7 +147,7 @@ public abstract class AbstractSocketEchoTest { } } - private class EchoHandler extends SimpleChannelUpstreamHandler { + private static class EchoHandler extends SimpleChannelUpstreamHandler { volatile Channel channel; final AtomicReference exception = new AtomicReference(); volatile int counter; diff --git a/src/test/java/org/jboss/netty/handler/codec/frame/AbstractSocketFixedLengthEchoTest.java b/src/test/java/org/jboss/netty/handler/codec/frame/AbstractSocketFixedLengthEchoTest.java index cdec5abda3..cca5dfd8f5 100644 --- a/src/test/java/org/jboss/netty/handler/codec/frame/AbstractSocketFixedLengthEchoTest.java +++ b/src/test/java/org/jboss/netty/handler/codec/frame/AbstractSocketFixedLengthEchoTest.java @@ -149,7 +149,7 @@ public abstract class AbstractSocketFixedLengthEchoTest { } } - private class EchoHandler extends SimpleChannelUpstreamHandler { + private static class EchoHandler extends SimpleChannelUpstreamHandler { volatile Channel channel; final AtomicReference exception = new AtomicReference(); volatile int counter; diff --git a/src/test/java/org/jboss/netty/handler/codec/serialization/AbstractSocketCompatibleObjectStreamEchoTest.java b/src/test/java/org/jboss/netty/handler/codec/serialization/AbstractSocketCompatibleObjectStreamEchoTest.java index 313c6d8a42..0aa8717dbf 100644 --- a/src/test/java/org/jboss/netty/handler/codec/serialization/AbstractSocketCompatibleObjectStreamEchoTest.java +++ b/src/test/java/org/jboss/netty/handler/codec/serialization/AbstractSocketCompatibleObjectStreamEchoTest.java @@ -157,7 +157,7 @@ public abstract class AbstractSocketCompatibleObjectStreamEchoTest { } } - private class EchoHandler extends SimpleChannelUpstreamHandler { + private static class EchoHandler extends SimpleChannelUpstreamHandler { volatile Channel channel; final AtomicReference exception = new AtomicReference(); volatile int counter; diff --git a/src/test/java/org/jboss/netty/handler/codec/serialization/AbstractSocketObjectStreamEchoTest.java b/src/test/java/org/jboss/netty/handler/codec/serialization/AbstractSocketObjectStreamEchoTest.java index a77b999cf7..32c511d1b2 100644 --- a/src/test/java/org/jboss/netty/handler/codec/serialization/AbstractSocketObjectStreamEchoTest.java +++ b/src/test/java/org/jboss/netty/handler/codec/serialization/AbstractSocketObjectStreamEchoTest.java @@ -156,7 +156,7 @@ public abstract class AbstractSocketObjectStreamEchoTest { } } - private class EchoHandler extends SimpleChannelUpstreamHandler { + private static class EchoHandler extends SimpleChannelUpstreamHandler { volatile Channel channel; final AtomicReference exception = new AtomicReference(); volatile int counter; diff --git a/src/test/java/org/jboss/netty/handler/codec/string/AbstractSocketStringEchoTest.java b/src/test/java/org/jboss/netty/handler/codec/string/AbstractSocketStringEchoTest.java index 720c4ef71b..786200804a 100644 --- a/src/test/java/org/jboss/netty/handler/codec/string/AbstractSocketStringEchoTest.java +++ b/src/test/java/org/jboss/netty/handler/codec/string/AbstractSocketStringEchoTest.java @@ -162,7 +162,7 @@ public abstract class AbstractSocketStringEchoTest { } } - private class EchoHandler extends SimpleChannelUpstreamHandler { + private static class EchoHandler extends SimpleChannelUpstreamHandler { volatile Channel channel; final AtomicReference exception = new AtomicReference(); volatile int counter; diff --git a/src/test/java/org/jboss/netty/handler/ssl/AbstractSocketSslEchoTest.java b/src/test/java/org/jboss/netty/handler/ssl/AbstractSocketSslEchoTest.java index fedf9b29c7..34aa06644c 100644 --- a/src/test/java/org/jboss/netty/handler/ssl/AbstractSocketSslEchoTest.java +++ b/src/test/java/org/jboss/netty/handler/ssl/AbstractSocketSslEchoTest.java @@ -194,7 +194,7 @@ public abstract class AbstractSocketSslEchoTest { } } - private class EchoHandler extends SimpleChannelUpstreamHandler { + private static class EchoHandler extends SimpleChannelUpstreamHandler { volatile Channel channel; final AtomicReference exception = new AtomicReference(); volatile int counter;