+ //
+ // But, don't return UPC-A if UPC-A was not a requested format!
+ boolean ean13MayBeUPCA =
+ BarcodeFormat.EAN_13.equals(result.getBarcodeFormat()) &&
+ result.getText().charAt(0) == '0';
+ Vector possibleFormats = hints == null ? null : (Vector) hints.get(DecodeHintType.POSSIBLE_FORMATS);
+ boolean canReturnUPCA = possibleFormats == null || possibleFormats.contains(BarcodeFormat.UPC_A);
+
+ if (ean13MayBeUPCA && canReturnUPCA) {