commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex (JIRA)" <>
Subject [jira] [Commented] (VALIDATOR-424) ISINCheckDigit could extend LuhnCheckDigit
Date Wed, 22 Aug 2018 18:38:00 GMT


Alex commented on VALIDATOR-424:

Thanks for the feedback. I'm happy to leave this if you feel it will be time sink relative
to any benefits. However, if I could make some final comments...

The weightedValue method is different between the 2 classes only in the final line. The line
used in the ISIN class uses a method made available from the ModulusCheckDigit Class which
looks like a better implementation over using the ternary operator. The 2 lines are equivalent
for small values ( < 18 ) which are all that should occur. I've now updated this to use
the method that is available in the ModulusCheckDigit Class.

A final class is one that cannot be extended. By removing the final we allow the LuhnCheckDigit
to extend the class. Other classes could now extend LuhnCheckDigit (good or bad?) and we have
would have an extra level in the inheritence hierarchy.


> ISINCheckDigit could extend LuhnCheckDigit
> ------------------------------------------
>                 Key: VALIDATOR-424
>                 URL:
>             Project: Commons Validator
>          Issue Type: Improvement
>    Affects Versions: 1.6
>            Reporter: Sebb
>            Priority: Major
> ISINCheckDigit is a version of Luhn which allows alphabetic characters.
> The class could extend the Luhn class.

This message was sent by Atlassian JIRA

View raw message