move to singleton ReaderException for a bit more performance
[zxing.git] / core / src / com / google / zxing / datamatrix / decoder / BitMatrixParser.java
index 1b4b304..443b099 100644 (file)
@@ -35,7 +35,7 @@ final class BitMatrixParser {
   BitMatrixParser(BitMatrix bitMatrix) throws ReaderException {\r
     int dimension = bitMatrix.getDimension();\r
     if (dimension < 10 || dimension > 144 || (dimension & 0x01) != 0) {\r
-      throw new ReaderException("Invalid dimension (" + dimension + ")  Must be 0 mod 2 and >= 10 and <= 144");\r
+      throw ReaderException.getInstance();\r
     }\r
     \r
     version = readVersion(bitMatrix);\r
@@ -141,7 +141,7 @@ final class BitMatrixParser {
     } while ((row < numRows) || (column < numColumns));\r
 \r
     if (resultOffset != version.getTotalCodewords()) {\r
-      throw new ReaderException("Did not read all codewords");\r
+      throw ReaderException.getInstance();\r
     }\r
     return result;\r
   }\r