#21 misleading error in EAN-13 message valudation

closed-fixed
nobody
None
5
2009-07-03
2009-07-02
cbowditch
No

According to Barcode4J documentation (http://barcode4j.sourceforge.net/1.0/barcode-xml.html#EAN-13) EAN-13 barcode must have a message length between 12 and 13. However, if you accidentally entr a message whose length is outside this range Barcoe4J throws the following error:

.lang.IllegalArgumentException: Message must be 11 or 12 characters long. Message: 1
at org.krysalis.barcode4j.impl.upcean.EAN13LogicImpl.validateMessage(EAN13LogicImpl.java:60)
at org.krysalis.barcode4j.impl.upcean.EAN13LogicImpl.generateBarcodeLogic(EAN13LogicImpl.java:115)

The attached patch corrects the misleading error message

Discussion

  • cbowditch
    cbowditch
    2009-07-02

    Proposed patch

     
    • status: open --> closed-fixed
     
  • Applied to CVS HEAD. Thanks a lot for spotting that, Chris! I wonder how that crept in.