commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodrigo Augusto Carlos Bispo (JIRA)" <>
Subject [jira] [Created] (VALIDATOR-320) CodeValidator - EAN13CheckDigit doesn't work
Date Mon, 03 Jun 2013 04:10:20 GMT
Rodrigo Augusto Carlos Bispo created VALIDATOR-320:

             Summary: CodeValidator - EAN13CheckDigit doesn't work
                 Key: VALIDATOR-320
             Project: Commons Validator
          Issue Type: Bug
          Components: Routines
    Affects Versions: 1.4.0 Release
            Reporter: Rodrigo Augusto Carlos Bispo
            Priority: Critical

This link show how to create a validator to validate EAN-13 codes (numeric, with a length
of 13)

However I tested the method and always returns "false", like this...

public boolean isCodeEAN13Valid(String code) {

	CodeValidator validator = new CodeValidator("^[0-9]*$", 13, EAN13CheckDigit.EAN13_CHECK_DIGIT);
	return = validator.isValid(code);

public void shouldBeAnValidCodeEAN13() {


1. Note that I used EAN13CheckDigit.EAN13_CHECK_DIGIT and not EAN13CheckDigit.INSTANCE.

2. I did not found information about EAN13CheckDigit.INSTANCE. Is it from what release of

3. My constructor of CodeValidator and how it was applied and used in example is really right?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message