X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=core%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fqrcode%2Fdetector%2FDetector.java;fp=core%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fqrcode%2Fdetector%2FDetector.java;h=a2aabdd84d2fcc9c49323a2aa3d9f646dc4b90c4;hb=1170ad08b19f495ae38daf72a816ac60e5606aae;hp=5739d9d08e0671c752cfd6afccedd96c626132bd;hpb=a8392ed7f61c9313eb630978f9d96b1725d6df10;p=zxing.git diff --git a/core/src/com/google/zxing/qrcode/detector/Detector.java b/core/src/com/google/zxing/qrcode/detector/Detector.java index 5739d9d0..a2aabdd8 100644 --- a/core/src/com/google/zxing/qrcode/detector/Detector.java +++ b/core/src/com/google/zxing/qrcode/detector/Detector.java @@ -75,7 +75,7 @@ public final class Detector { float moduleSize = calculateModuleSize(topLeft, topRight, bottomLeft); if (moduleSize < 1.0f) { - throw new ReaderException("Module size too small"); + throw ReaderException.getInstance(); } int dimension = computeDimension(topLeft, topRight, bottomLeft, moduleSize); Version provisionalVersion = Version.getProvisionalVersionForDimension(dimension); @@ -108,7 +108,7 @@ public final class Detector { } } if (alignmentPattern == null) { - throw new ReaderException("Could not find alignment pattern"); + throw ReaderException.getInstance(); } } @@ -188,7 +188,7 @@ public final class Detector { dimension--; break; case 3: - throw new ReaderException("Bad dimension: " + dimension); + throw ReaderException.getInstance(); } return dimension; } @@ -335,7 +335,7 @@ public final class Detector { int alignmentAreaLeftX = Math.max(0, estAlignmentX - allowance); int alignmentAreaRightX = Math.min(image.getWidth() - 1, estAlignmentX + allowance); if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) { - throw new ReaderException("Alignment pattern is too small to search"); + throw ReaderException.getInstance(); } int alignmentAreaTopY = Math.max(0, estAlignmentY - allowance);