Ported r2344 from ZXing

Original commit message: "More inspection stuff, mostly making things
final that are not intended for extension"