Closed aSemy closed 2 years ago
Hi @aSemy, thanks for reporting this bug. It will be fixed in 4.0.0.
This issue relates to #82. Not sure why I choose to raise an exception instead of simply returning false. Maybe because those check digits are not supposed to be possible.
@aSemy, the bug has been fixed in 4.0.0. But I am still far from releasing this version, so if it's important to you let me know and I will backport the fix to 3.x.
Thanks! There's no rush, I've wrapped it in a try/catch block for now.
OK, this will wait until the 4.0.0 is released then. Thanks again for reporting this bug !
Describe the bug
When I use
Iban.isValid()
it throws an exception when the IBAN is invalid.I expect that it does not throw an exception, as per the Javadoc
https://github.com/marcwrobel/jbanking/blob/657cabe29dad16ba7251e793e1b2da6a9598e978/src/main/java/fr/marcwrobel/jbanking/iban/Iban.java#L144-L153
To Reproduce
I was using the test data from Apache Commons Validator https://github.com/apache/commons-validator/blob/fe3a76cc3452ec4a3a034aca7c05bcd103390c52/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
Expected behavior
If an IBAN is invalid then
Iban.isValid()
returnsfalse
and does not throw an exception.Alternatively, if
Iban.isValid()
must throw an exception, then this is documented in the Javadoc.Context: