Caught a few J2ME incompatibilities in build
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 4 Mar 2010 18:53:58 +0000 (18:53 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 4 Mar 2010 18:53:58 +0000 (18:53 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1235 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/common/GridSampler.java
core/src/com/google/zxing/oned/rss/RSS14Reader.java

index 84024be..3b55eb6 100644 (file)
@@ -95,7 +95,7 @@ public abstract class GridSampler {
   public BitMatrix sampleGrid(BitMatrix image,
                               int dimension,
                               PerspectiveTransform transform) throws NotFoundException {
-    throw new UnsupportedOperationException();
+    throw new IllegalStateException(); // Can't use UnsupportedOperationException
   }
   
 
index 962026c..c9f84c3 100644 (file)
@@ -81,12 +81,12 @@ public final class RSS14Reader extends OneDReader {
   public Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws NotFoundException {
     Pair leftPair = decodePair(row, false, rowNumber, hints);
     if (leftPair != null) {
-      possibleLeftPairs.add(leftPair);
+      possibleLeftPairs.addElement(leftPair);
     }
     row.reverse();
     Pair rightPair = decodePair(row, true, rowNumber, hints);
     if (rightPair != null) {
-      possibleRightPairs.add(rightPair);
+      possibleRightPairs.addElement(rightPair);
     }
     row.reverse();
     int numLeftPairs = possibleLeftPairs.size();
@@ -104,8 +104,8 @@ public final class RSS14Reader extends OneDReader {
   }
 
   public void reset() {
-    possibleLeftPairs.clear();
-    possibleRightPairs.clear();
+    possibleLeftPairs.setSize(0);
+    possibleRightPairs.setSize(0);
   }
 
   private static Result constructResult(Pair leftPair, Pair rightPair) {