diff --git a/src/main/java/org/jboss/netty/example/qotm/QuoteOfTheMomentServerHandler.java b/src/main/java/org/jboss/netty/example/qotm/QuoteOfTheMomentServerHandler.java index e04b010a0e..8119117832 100644 --- a/src/main/java/org/jboss/netty/example/qotm/QuoteOfTheMomentServerHandler.java +++ b/src/main/java/org/jboss/netty/example/qotm/QuoteOfTheMomentServerHandler.java @@ -27,7 +27,7 @@ public class QuoteOfTheMomentServerHandler extends SimpleChannelUpstreamHandler private static final Random random = new Random(); // Quotes from Mohandas K. Gandhi: - private static final String[] quotes = new String[] { + private static final String[] quotes = { "Where there is love there is life.", "First they ignore you, then they laugh at you, then they fight you, then you win.", "Be the change you want to see in the world.", diff --git a/src/main/java/org/jboss/netty/example/securechat/SecureChatKeyStore.java b/src/main/java/org/jboss/netty/example/securechat/SecureChatKeyStore.java index bfcd88bec7..e871d0e09d 100644 --- a/src/main/java/org/jboss/netty/example/securechat/SecureChatKeyStore.java +++ b/src/main/java/org/jboss/netty/example/securechat/SecureChatKeyStore.java @@ -31,7 +31,7 @@ import java.io.InputStream; * */ public final class SecureChatKeyStore { - private static final short[] DATA = new short[] { + private static final short[] DATA = { 0xfe, 0xed, 0xfe, 0xed, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageEncoder.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageEncoder.java index 27a51b0e18..ef59e77be5 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageEncoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageEncoder.java @@ -15,12 +15,6 @@ */ package org.jboss.netty.handler.codec.http; -import static org.jboss.netty.buffer.ChannelBuffers.*; -import static org.jboss.netty.handler.codec.http.HttpConstants.*; - -import java.io.UnsupportedEncodingException; -import java.util.Map; - import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; @@ -30,6 +24,12 @@ import org.jboss.netty.handler.codec.http.HttpHeaders.Values; import org.jboss.netty.handler.codec.oneone.OneToOneEncoder; import org.jboss.netty.util.CharsetUtil; +import java.io.UnsupportedEncodingException; +import java.util.Map; + +import static org.jboss.netty.buffer.ChannelBuffers.*; +import static org.jboss.netty.handler.codec.http.HttpConstants.*; + /** * Encodes an {@link HttpMessage} or an {@link HttpChunk} into * a {@link ChannelBuffer}. @@ -46,7 +46,7 @@ import org.jboss.netty.util.CharsetUtil; */ public abstract class HttpMessageEncoder extends OneToOneEncoder { - private static final byte[] CRLF = new byte[] { CR, LF }; + private static final byte[] CRLF = { CR, LF }; private static final ChannelBuffer LAST_CHUNK = copiedBuffer("0\r\n\r\n", CharsetUtil.US_ASCII); diff --git a/src/test/java/org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java b/src/test/java/org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java index 1146259810..08efb11ed7 100644 --- a/src/test/java/org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java +++ b/src/test/java/org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java @@ -89,7 +89,7 @@ public class ReadOnlyChannelBufferTest { expect(buf.getLong(21)).andReturn(22L); ByteBuffer bb = ByteBuffer.allocate(100); - ByteBuffer[] bbs = new ByteBuffer[] { ByteBuffer.allocate(101), ByteBuffer.allocate(102) }; + ByteBuffer[] bbs = { ByteBuffer.allocate(101), ByteBuffer.allocate(102) }; expect(buf.toByteBuffer(23, 24)).andReturn(bb); expect(buf.toByteBuffers(25, 26)).andReturn(bbs); diff --git a/src/test/java/org/jboss/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoderTest.java b/src/test/java/org/jboss/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoderTest.java index 907ffbe7d5..bd9ed30d34 100644 --- a/src/test/java/org/jboss/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoderTest.java +++ b/src/test/java/org/jboss/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoderTest.java @@ -37,7 +37,7 @@ public class ProtobufVarint32FrameDecoderTest { @Test public void testTinyDecode() { - byte[] b = new byte[] { 4, 1, 1, 1, 1 }; + byte[] b = { 4, 1, 1, 1, 1 }; embedder.offer(wrappedBuffer(b, 0, 1)); assertThat(embedder.poll(), is(nullValue())); embedder.offer(wrappedBuffer(b, 1, 2)); diff --git a/src/test/java/org/jboss/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java b/src/test/java/org/jboss/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java index d0302a7ae7..a4897f07c1 100644 --- a/src/test/java/org/jboss/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java +++ b/src/test/java/org/jboss/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java @@ -36,7 +36,7 @@ public class ProtobufVarint32LengthFieldPrependerTest { @Test public void testTinyEncode() { - byte[] b = new byte[] { 4, 1, 1, 1, 1 }; + byte[] b = { 4, 1, 1, 1, 1 }; embedder.offer(wrappedBuffer(b, 1, b.length - 1)); assertThat(embedder.poll(), is(wrappedBuffer(b))); }