From f84a9e1c52d72df240975ab0a9832c14d69eb458 Mon Sep 17 00:00:00 2001 From: "Craig P. Motlin" Date: Wed, 9 Nov 2011 20:41:11 -0500 Subject: [PATCH] Add missing @Override annotations. --- .../client/WebSocketClientFactory.java | 1 + .../client/WebSocketClientHandler.java | 3 + .../netty/example/iostream/IOStream.java | 1 + .../example/localtime/LocalTimeProtocol.java | 77 +++++++++++++++++++ .../codec/http/websocketx/UTF8Output.java | 1 + 5 files changed, 83 insertions(+) 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..4668234d20 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,15 +52,18 @@ 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(); @@ -106,6 +110,7 @@ public final class LocalTimeProtocol { ; + @Override public final int getNumber() { return value; } public static DayOfWeek valueOf(int value) { @@ -128,15 +133,18 @@ 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(); @@ -184,6 +192,7 @@ public final class LocalTimeProtocol { return defaultInstance; } + @Override public Location getDefaultInstanceForType() { return defaultInstance; } @@ -193,6 +202,7 @@ public final class LocalTimeProtocol { 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,6 +225,7 @@ public final class LocalTimeProtocol { private void initFields() { continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; } + @Override public final 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,6 +555,7 @@ public final class LocalTimeProtocol { return defaultInstance; } + @Override public Locations getDefaultInstanceForType() { return defaultInstance; } @@ -539,6 +565,7 @@ public final class LocalTimeProtocol { 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,6 +585,7 @@ public final class LocalTimeProtocol { private void initFields() { } + @Override public final boolean isInitialized() { for (org.jboss.netty.example.localtime.LocalTimeProtocol.Location element : getLocationList()) { if (!element.isInitialized()) { @@ -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,6 +912,7 @@ public final class LocalTimeProtocol { return defaultInstance; } + @Override public LocalTime getDefaultInstanceForType() { return defaultInstance; } @@ -879,6 +922,7 @@ public final class LocalTimeProtocol { 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,6 +980,7 @@ public final class LocalTimeProtocol { private void initFields() { dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY; } + @Override public final 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,6 +1482,7 @@ public final class LocalTimeProtocol { return defaultInstance; } + @Override public LocalTimes getDefaultInstanceForType() { return defaultInstance; } @@ -1432,6 +1492,7 @@ public final class LocalTimeProtocol { 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,6 +1512,7 @@ public final class LocalTimeProtocol { private void initFields() { } + @Override public final boolean isInitialized() { for (org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime element : getLocalTimeList()) { if (!element.isInitialized()) { @@ -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/http/websocketx/UTF8Output.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/UTF8Output.java index 2efe690871..70e2bec308 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/UTF8Output.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/UTF8Output.java @@ -67,6 +67,7 @@ public class UTF8Output { } } + @Override public String toString() { if (state != UTF8_ACCEPT) { throw new UTF8Exception("bytes are not UTF-8");