Standardize array initializer syntax to use the form without "new type[]", to be consistent and make translation to C++ easier

git-svn-id: https://zxing.googlecode.com/svn/trunk@348 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-04-07 19:42:35 +00:00
parent 9c1b4a1393
commit a5b385e764
10 changed files with 16 additions and 16 deletions

View file

@ -26,7 +26,7 @@ import com.google.zxing.Result;
*/
public final class NDEFURIParsedResult extends AbstractNDEFParsedResult {
private static final String[] URI_PREFIXES = new String[] {
private static final String[] URI_PREFIXES = {
null,
"http://www.",
"https://www.",

View file

@ -33,13 +33,13 @@ final class DecodedBitStreamParser {
* See ISO 16022:2006, Annex C Table C.1
* The C40 Basic Character Set (*'s used for placeholders for the shift values)
*/
private static final char[] C40_BASIC_SET_CHARS = new char[]{
private static final char[] C40_BASIC_SET_CHARS = {
'*', '*', '*', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
};
private static final char[] C40_SHIFT2_SET_CHARS = new char[]{
private static final char[] C40_SHIFT2_SET_CHARS = {
'!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.',
'/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_'
};
@ -48,13 +48,13 @@ final class DecodedBitStreamParser {
* See ISO 16022:2006, Annex C Table C.2
* The Text Basic Character Set (*'s used for placeholders for the shift values)
*/
private static final char[] TEXT_BASIC_SET_CHARS = new char[]{
private static final char[] TEXT_BASIC_SET_CHARS = {
'*', '*', '*', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
};
private static final char[] TEXT_SHIFT3_SET_CHARS = new char[]{
private static final char[] TEXT_SHIFT3_SET_CHARS = {
'\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', 127
};

View file

@ -32,7 +32,7 @@ abstract class DataMask {
/**
* See ISO 18004:2006 6.8.1
*/
private static final DataMask[] DATA_MASKS = new DataMask[]{
private static final DataMask[] DATA_MASKS = {
new DataMask000(),
new DataMask001(),
new DataMask010(),

View file

@ -34,7 +34,7 @@ final class DecodedBitStreamParser {
/**
* See ISO 18004:2006, 6.4.4 Table 5
*/
private static final char[] ALPHANUMERIC_CHARS = new char[]{
private static final char[] ALPHANUMERIC_CHARS = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',

View file

@ -45,7 +45,7 @@ final class ErrorCorrectionLevel {
*/
static final ErrorCorrectionLevel H = new ErrorCorrectionLevel(3);
private static final ErrorCorrectionLevel[] FOR_BITS = new ErrorCorrectionLevel[]{M, L, H, Q};
private static final ErrorCorrectionLevel[] FOR_BITS = {M, L, H, Q};
private final int ordinal;

View file

@ -33,7 +33,7 @@ final class FormatInformation {
/**
* See ISO 18004:2006, Annex C, Table C.1
*/
private static final int[][] FORMAT_INFO_DECODE_LOOKUP = new int[][]{
private static final int[][] FORMAT_INFO_DECODE_LOOKUP = {
{0x5412, 0x00},
{0x5125, 0x01},
{0x5E7C, 0x02},

View file

@ -30,7 +30,7 @@ public final class Version {
* See ISO 18004:2006 Annex D.
* Element i represents the raw version bits that specify version i + 7
*/
private static final int[] VERSION_DECODE_INFO = new int[]{
private static final int[] VERSION_DECODE_INFO = {
0x07C94, 0x085BC, 0x09A99, 0x0A4D3, 0x0BBF6,
0x0C762, 0x0D847, 0x0E60D, 0x0F928, 0x10B78,
0x1145D, 0x12A17, 0x13532, 0x149A6, 0x15683,

View file

@ -24,7 +24,7 @@ import junit.framework.TestCase;
public final class BitSourceTestCase extends TestCase {
public void testSource() {
byte[] bytes = new byte[]{(byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5};
byte[] bytes = {(byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5};
BitSource source = new BitSource(bytes);
assertEquals(40, source.available());
assertEquals(0, source.readBits(1));

View file

@ -49,7 +49,7 @@ public final class PerspectiveTransformTestCase extends TestCase {
}
private static void assertPointEquals(float expectedX, float expectedY, float sourceX, float sourceY, PerspectiveTransform pt) {
float[] points = new float[]{sourceX, sourceY};
float[] points = {sourceX, sourceY};
pt.transformPoints(points);
assertEquals(expectedX, points[0], EPSILON);
assertEquals(expectedY, points[1], EPSILON);

View file

@ -27,16 +27,16 @@ public final class DecodedBitStreamParserTestCase extends TestCase{
public void testAsciiStandardDecode() throws ReaderException {
// ASCII characters 0-127 are encoded as the value + 1
byte[] bytes = new byte[]{(byte) ('a' + 1), (byte) ('b' + 1), (byte) ('c' + 1),
(byte) ('A' + 1), (byte) ('B' + 1), (byte) ('C' + 1)};
byte[] bytes = {(byte) ('a' + 1), (byte) ('b' + 1), (byte) ('c' + 1),
(byte) ('A' + 1), (byte) ('B' + 1), (byte) ('C' + 1)};
String decodedString = DecodedBitStreamParser.decode(bytes);
assertEquals("abcABC", decodedString);
}
public void testAsciiDoubleDigitDecode() throws ReaderException{
// ASCII double digit (00 - 99) Numeric Value + 130
byte[] bytes = new byte[]{(byte) (00 + 130), (byte) (01 + 130),
(byte) (98 + 130), (byte) (99 + 130)};
byte[] bytes = {(byte) 130 , (byte) ( 1 + 130),
(byte) (98 + 130), (byte) (99 + 130)};
String decodedString = DecodedBitStreamParser.decode(bytes);
assertEquals("00019899", decodedString);
}