You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "sahvx655-wq (via GitHub)" <gi...@apache.org> on 2026/07/03 14:35:04 UTC
[PR] reject vowels in SedolCheckDigit [commons-validator]
sahvx655-wq opened a new pull request, #415:
URL: https://github.com/apache/commons-validator/pull/415
`SedolCheckDigit.toInt` already rejects out-of-range and non-alphanumeric characters, but it accepts vowels. The SEDOL alphabet deliberately omits A, E, I, O and U (as noted in the Wikipedia reference in the class Javadoc), so no genuine SEDOL contains one. Whilst working through these routines I generated a correct modulus-10 check digit for bodies containing vowels and found `SEDOL_CHECK_DIGIT.isValid` returning true for codes such as `B0AKT02` and `AAAAAA0`. There is no `SedolValidator` wrapping this routine, so `SedolCheckDigit.isValid` is the only public SEDOL entry point and the over-acceptance is user visible: a string that can never be a real SEDOL passes validation purely because its check digit happens to line up.
The fix rejects vowels in `toInt`, next to the existing alphanumeric-range check, which is where the other per-character SEDOL rules already live, so the whole character set stays enforced in one place rather than being pushed onto callers. The added test asserts vowel-bearing codes with valid check digits are rejected while the existing consonant fixtures still validate; it fails before the change and passes after.
- [x] Read the [contribution guidelines](CONTRIBUTING.md) for this project.
- [x] Run a successful build using the default Maven goal with `mvn`.
- [x] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Each commit in the pull request should have a meaningful subject line and body.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Reject vowels in SedolCheckDigit [commons-validator]
Posted by "sahvx655-wq (via GitHub)" <gi...@apache.org>.
sahvx655-wq commented on PR #415:
URL: https://github.com/apache/commons-validator/pull/415#issuecomment-4880692993
Makes sense. Switched testVowelsRejected to a @ParameterizedTest driven by @ValueSource and dropped the loop. Added a fixture per vowel that isolates it: A000000, E000006, I000002, O000006 and U000000, each a single vowel in the body with a correct modulus 10 check digit, so they only fail once the vowel exclusion is applied rather than on a check-digit mismatch. The earlier multi-vowel codes (B0AKT02, 0EIOU02, BAEIOU7, AAAAAA0) are kept as further fixtures.
Each row now runs as its own invocation, so a regression on one particular vowel points straight at that vowel instead of failing the whole loop. Full build stays green.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Reject vowels in SedolCheckDigit [commons-validator]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #415:
URL: https://github.com/apache/commons-validator/pull/415#issuecomment-4881895147
@sahvx655-wq
You forgot to update the Javadoc, I'll fix that in git master.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Reject vowels in SedolCheckDigit [commons-validator]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #415:
URL: https://github.com/apache/commons-validator/pull/415
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org