public BitMatrix sampleGrid(BitMatrix image,
int dimension,
PerspectiveTransform transform) throws NotFoundException {
- throw new UnsupportedOperationException();
+ throw new IllegalStateException(); // Can't use UnsupportedOperationException
}
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();
}
public void reset() {
- possibleLeftPairs.clear();
- possibleRightPairs.clear();
+ possibleLeftPairs.setSize(0);
+ possibleRightPairs.setSize(0);
}
private static Result constructResult(Pair leftPair, Pair rightPair) {