Replace constant array creation expression with array initializer.
This commit is contained in:
parent
e84571a5f2
commit
d073e1d14d
@ -32,7 +32,7 @@ public class QuoteOfTheMomentServerHandler extends SimpleChannelUpstreamHandler
|
|||||||
private static final Random random = new Random();
|
private static final Random random = new Random();
|
||||||
|
|
||||||
// Quotes from Mohandas K. Gandhi:
|
// Quotes from Mohandas K. Gandhi:
|
||||||
private static final String[] quotes = new String[] {
|
private static final String[] quotes = {
|
||||||
"Where there is love there is life.",
|
"Where there is love there is life.",
|
||||||
"First they ignore you, then they laugh at you, then they fight you, then you win.",
|
"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.",
|
"Be the change you want to see in the world.",
|
||||||
|
@ -36,7 +36,7 @@ import java.io.InputStream;
|
|||||||
* @version $Rev$, $Date$
|
* @version $Rev$, $Date$
|
||||||
*/
|
*/
|
||||||
public class SecureChatKeyStore {
|
public class SecureChatKeyStore {
|
||||||
private static final short[] DATA = new short[] {
|
private static final short[] DATA = {
|
||||||
0xfe, 0xed, 0xfe, 0xed, 0x00, 0x00, 0x00, 0x02,
|
0xfe, 0xed, 0xfe, 0xed, 0x00, 0x00, 0x00, 0x02,
|
||||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
|
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
|
||||||
0x00, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
|
0x00, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
|
||||||
|
@ -50,7 +50,7 @@ class HttpCodecUtil {
|
|||||||
/**
|
/**
|
||||||
* carriage return line feed
|
* carriage return line feed
|
||||||
*/
|
*/
|
||||||
static final byte[] CRLF = new byte[] { CR, LF };
|
static final byte[] CRLF = { CR, LF };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Colon ':'
|
* Colon ':'
|
||||||
|
@ -93,7 +93,7 @@ public class ReadOnlyChannelBufferTest {
|
|||||||
expect(buf.getLong(21)).andReturn(22L);
|
expect(buf.getLong(21)).andReturn(22L);
|
||||||
|
|
||||||
ByteBuffer bb = ByteBuffer.allocate(100);
|
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.toByteBuffer(23, 24)).andReturn(bb);
|
||||||
expect(buf.toByteBuffers(25, 26)).andReturn(bbs);
|
expect(buf.toByteBuffers(25, 26)).andReturn(bbs);
|
||||||
|
@ -106,7 +106,7 @@ public class QueryStringDecoderTest {
|
|||||||
// not rely on the platform's default encoding (not portable).
|
// not rely on the platform's default encoding (not portable).
|
||||||
new byte[] {'C', 'a', 'f', 'f', (byte) 0xC3, (byte) 0xA9},
|
new byte[] {'C', 'a', 'f', 'f', (byte) 0xC3, (byte) 0xA9},
|
||||||
"UTF-8");
|
"UTF-8");
|
||||||
final String[] tests = new String[] {
|
final String[] tests = {
|
||||||
// Encoded -> Decoded or error message substring
|
// Encoded -> Decoded or error message substring
|
||||||
"", "",
|
"", "",
|
||||||
"foo", "foo",
|
"foo", "foo",
|
||||||
|
@ -42,7 +42,7 @@ public class ProtobufVarint32FrameDecoderTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTinyDecode() {
|
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));
|
embedder.offer(wrappedBuffer(b, 0, 1));
|
||||||
assertThat(embedder.poll(), is(nullValue()));
|
assertThat(embedder.poll(), is(nullValue()));
|
||||||
embedder.offer(wrappedBuffer(b, 1, 2));
|
embedder.offer(wrappedBuffer(b, 1, 2));
|
||||||
|
@ -41,7 +41,7 @@ public class ProtobufVarint32LengthFieldPrependerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTinyEncode() {
|
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));
|
embedder.offer(wrappedBuffer(b, 1, b.length - 1));
|
||||||
assertThat(embedder.poll(), is(wrappedBuffer(b)));
|
assertThat(embedder.poll(), is(wrappedBuffer(b)));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user