Replace constant array creation expression with array initializer.

This commit is contained in:
Craig P. Motlin 2011-11-12 13:14:39 -05:00
parent e84571a5f2
commit d073e1d14d
7 changed files with 7 additions and 7 deletions

View File

@ -32,7 +32,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.",

View File

@ -36,7 +36,7 @@ import java.io.InputStream;
* @version $Rev$, $Date$
*/
public 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,

View File

@ -50,7 +50,7 @@ class HttpCodecUtil {
/**
* carriage return line feed
*/
static final byte[] CRLF = new byte[] { CR, LF };
static final byte[] CRLF = { CR, LF };
/**
* Colon ':'

View File

@ -93,7 +93,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);

View File

@ -106,7 +106,7 @@ public class QueryStringDecoderTest {
// not rely on the platform's default encoding (not portable).
new byte[] {'C', 'a', 'f', 'f', (byte) 0xC3, (byte) 0xA9},
"UTF-8");
final String[] tests = new String[] {
final String[] tests = {
// Encoded -> Decoded or error message substring
"", "",
"foo", "foo",

View File

@ -42,7 +42,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));

View File

@ -41,7 +41,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)));
}