commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (VALIDATOR-336) CUSIPCheckDigit Thinks Invalid CUSIP is Valid
Date Sun, 16 Nov 2014 14:51:33 GMT


Sebb commented on VALIDATOR-336:

bq. ISBN is an exception to the rule that the checkdigit can not be a letter.

If most other subclasses of ModulusCheckDigit only permit digits, then maybe the solution
is to fix ISBN etc.?
Do any other algorithms incorrectly allow non-digits?

> CUSIPCheckDigit Thinks Invalid CUSIP is Valid
> ---------------------------------------------
>                 Key: VALIDATOR-336
>                 URL:
>             Project: Commons Validator
>          Issue Type: Bug
>            Reporter: Josh Meyer
>         Attachments:,,,
> When testing if a specific CUSIP is valid using org.apache.commons.validator.routines.checkdigit.CUSIPCheckDigit.CUSIP_CHECK_DIGIT.isValid,
a call to this returns true when it should return false. A specific example is with the following
invalid CUSIP: DUS0421CW.
> What seems to be happening is when toInt is called on W it turns it to an int value and
then sends it to weightedValue. This is fine for the first 8 characters of a CUSIP, but not
the check digit. The expected result should be to return false because the check digit is
a letter (on a CUSIP a check digit must be 0-9). 
> With the current implementation, I believe each CUSIP can have up to 4 valid check digits.
> A test is attached.

This message was sent by Atlassian JIRA

View raw message