From: srowen Date: Mon, 7 Apr 2008 19:42:35 +0000 (+0000) Subject: Standardize array initializer syntax to use the form without "new type[]", to be... X-Git-Url: http://git.rot13.org/?p=zxing.git;a=commitdiff_plain;h=30e59ce85f8993a69a67c4ded7cbc1b652ac4081 Standardize array initializer syntax to use the form without "new type[]", to be consistent and make translation to C++ easier git-svn-id: http://zxing.googlecode.com/svn/trunk@348 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- diff --git a/core/src/com/google/zxing/client/result/NDEFURIParsedResult.java b/core/src/com/google/zxing/client/result/NDEFURIParsedResult.java index bb6d985b..df64ac65 100644 --- a/core/src/com/google/zxing/client/result/NDEFURIParsedResult.java +++ b/core/src/com/google/zxing/client/result/NDEFURIParsedResult.java @@ -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.", diff --git a/core/src/com/google/zxing/datamatrix/decoder/DecodedBitStreamParser.java b/core/src/com/google/zxing/datamatrix/decoder/DecodedBitStreamParser.java index 09dcebe5..ea68b65d 100644 --- a/core/src/com/google/zxing/datamatrix/decoder/DecodedBitStreamParser.java +++ b/core/src/com/google/zxing/datamatrix/decoder/DecodedBitStreamParser.java @@ -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 }; diff --git a/core/src/com/google/zxing/qrcode/decoder/DataMask.java b/core/src/com/google/zxing/qrcode/decoder/DataMask.java index d55a0866..e55ff1f9 100755 --- a/core/src/com/google/zxing/qrcode/decoder/DataMask.java +++ b/core/src/com/google/zxing/qrcode/decoder/DataMask.java @@ -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(), diff --git a/core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java b/core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java index 712a0cbc..b53a7cf5 100644 --- a/core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java +++ b/core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java @@ -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', diff --git a/core/src/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java b/core/src/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java index 0e83d58b..3d1f2d05 100644 --- a/core/src/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java +++ b/core/src/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java @@ -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; diff --git a/core/src/com/google/zxing/qrcode/decoder/FormatInformation.java b/core/src/com/google/zxing/qrcode/decoder/FormatInformation.java index 22347460..c257f094 100644 --- a/core/src/com/google/zxing/qrcode/decoder/FormatInformation.java +++ b/core/src/com/google/zxing/qrcode/decoder/FormatInformation.java @@ -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}, diff --git a/core/src/com/google/zxing/qrcode/decoder/Version.java b/core/src/com/google/zxing/qrcode/decoder/Version.java index d30fdeb2..f5abfeca 100755 --- a/core/src/com/google/zxing/qrcode/decoder/Version.java +++ b/core/src/com/google/zxing/qrcode/decoder/Version.java @@ -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, diff --git a/core/test/src/com/google/zxing/common/BitSourceTestCase.java b/core/test/src/com/google/zxing/common/BitSourceTestCase.java index 3f618315..180385a0 100644 --- a/core/test/src/com/google/zxing/common/BitSourceTestCase.java +++ b/core/test/src/com/google/zxing/common/BitSourceTestCase.java @@ -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)); diff --git a/core/test/src/com/google/zxing/common/PerspectiveTransformTestCase.java b/core/test/src/com/google/zxing/common/PerspectiveTransformTestCase.java index 5b5834dc..19bc8095 100644 --- a/core/test/src/com/google/zxing/common/PerspectiveTransformTestCase.java +++ b/core/test/src/com/google/zxing/common/PerspectiveTransformTestCase.java @@ -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); diff --git a/core/test/src/com/google/zxing/datamatrix/decoder/DecodedBitStreamParserTestCase.java b/core/test/src/com/google/zxing/datamatrix/decoder/DecodedBitStreamParserTestCase.java index dd3380a3..a4d62730 100644 --- a/core/test/src/com/google/zxing/datamatrix/decoder/DecodedBitStreamParserTestCase.java +++ b/core/test/src/com/google/zxing/datamatrix/decoder/DecodedBitStreamParserTestCase.java @@ -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); }