Spell checker fixes, narrowed scope / made less visible where possible. Little stuff
[zxing.git] / core / src / com / google / zxing / pdf417 / decoder / DecodedBitStreamParser.java
index d2f4d3d..a8cf592 100644 (file)
@@ -109,7 +109,7 @@ final class DecodedBitStreamParser {
           break;\r
         }\r
         default: {\r
-          // Default to text compaction. During testing numberous barcodes\r
+          // Default to text compaction. During testing numerous barcodes\r
           // appeared to be missing the starting mode. In these cases defaulting\r
           // to text compaction seems to work.\r
           codeIndex--;\r
@@ -123,7 +123,7 @@ final class DecodedBitStreamParser {
         throw ReaderException.getInstance();\r
       }\r
     }\r
-    return new DecoderResult(null, result.toString(), null);\r
+    return new DecoderResult(null, result.toString(), null, null);\r
   }\r
 \r
   /**\r
@@ -138,15 +138,14 @@ final class DecodedBitStreamParser {
    */\r
   private static int textCompaction(int[] codewords, int codeIndex, StringBuffer result) {\r
     // 2 character per codeword\r
-    int[] textCompactionData = new int[codewords[0] * 2];\r
+    int[] textCompactionData = new int[codewords[0] << 1];\r
     // Used to hold the byte compaction value if there is a mode shift\r
-    int[] byteCompactionData = new int[codewords[0] * 2];\r
+    int[] byteCompactionData = new int[codewords[0] << 1];\r
 \r
     int index = 0;\r
-    int code = 0;\r
     boolean end = false;\r
     while ((codeIndex < codewords[0]) && !end) {\r
-      code = codewords[codeIndex++];\r
+      int code = codewords[codeIndex++];\r
       if (code < TEXT_COMPACTION_MODE_LATCH) {\r
         textCompactionData[index] = code / 30;\r
         textCompactionData[index + 1] = code % 30;\r
@@ -341,10 +340,9 @@ final class DecodedBitStreamParser {
       long value = 0;\r
       char[] decodedData = new char[6];\r
       int[] byteCompactedCodewords = new int[6];\r
-      int code = 0;\r
       boolean end = false;\r
       while ((codeIndex < codewords[0]) && !end) {\r
-        code = codewords[codeIndex++];\r
+        int code = codewords[codeIndex++];\r
         if (code < TEXT_COMPACTION_MODE_LATCH) {\r
           byteCompactedCodewords[count] = code;\r
           count++;\r
@@ -386,10 +384,9 @@ final class DecodedBitStreamParser {
       // is an integer multiple of 6\r
       int count = 0;\r
       long value = 0;\r
-      int code = 0;\r
       boolean end = false;\r
       while ((codeIndex < codewords[0]) && !end) {\r
-        code = codewords[codeIndex++];\r
+        int code = codewords[codeIndex++];\r
         if (code < TEXT_COMPACTION_MODE_LATCH) {\r
           count += 1;\r
           // Base 900\r
@@ -515,9 +512,8 @@ final class DecodedBitStreamParser {
    */\r
   private static String decodeBase900toBase10(int[] codewords, int count) {\r
     StringBuffer accum = null;\r
-    StringBuffer value = null;\r
     for (int i = 0; i < count; i++) {\r
-      value = multiply(EXP900[count - i - 1], codewords[i]);\r
+      StringBuffer value = multiply(EXP900[count - i - 1], codewords[i]);\r
       if (accum == null) {\r
         // First time in accum=0\r
         accum = value;\r
@@ -526,7 +522,7 @@ final class DecodedBitStreamParser {
       }\r
     }\r
     String result = null;\r
-    // Remove leading '1' which was inserted to preserce\r
+    // Remove leading '1' which was inserted to preserve\r
     // leading zeros\r
     for (int i = 0; i < accum.length(); i++) {\r
       if (accum.charAt(i) == '1') {\r