- // Here is, therefore, where we implement this logic:
- if (result.getBarcodeFormat().equals(BarcodeFormat.EAN_13) &&
- result.getText().charAt(0) == '0') {
+ // In this case, if we've been looking for both types, we'd like to call it
+ // a UPC-A code. But for efficiency we only run the EAN-13 decoder to also read
+ // UPC-A. So we special case it here, and convert an EAN-13 result to a UPC-A
+ // result if appropriate.
+ if (result.getBarcodeFormat().equals(BarcodeFormat.EAN_13) && result.getText().charAt(0) == '0') {