Issue #63 : minor formatting and doc changes

This commit is contained in:
Sean Owen 2014-02-18 12:49:30 +00:00
parent 347813c971
commit bd4536f077
2 changed files with 11 additions and 10 deletions

View file

@ -90,12 +90,13 @@ public enum DecodeHintType {
/**
* Allowed extension lengths for EAN or UPC barcodes.
* Other formats will ignore this.
* Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
* Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
* If it is optional to have an extension, do not set this hint.
* If it is optional to have an extension, do not set this hint. If this is set,
* and a UPC or EAN barcode is found but an extension is not, then no result will be returned
* at all.
*/
ALLOWED_EAN_EXTENSIONS(int[].class);
ALLOWED_EAN_EXTENSIONS(int[].class),
// End of enumeration values.
;

View file

@ -206,8 +206,8 @@ public abstract class UPCEANReader extends OneDReader {
// continue
}
int[] allowedExtensions = hints == null ? null :
(int[])hints.get(DecodeHintType.ALLOWED_EAN_EXTENSIONS);
int[] allowedExtensions =
hints == null ? null : (int[]) hints.get(DecodeHintType.ALLOWED_EAN_EXTENSIONS);
if (allowedExtensions != null) {
boolean valid = false;
for (int length : allowedExtensions) {