jpos / jPOS

jPOS Project
http://jpos.org
GNU Affero General Public License v3.0
609 stars 461 forks source link

ISOUtil.hex2byte should cry when hex string is not hex #505

Open ar opened 1 year ago

ar commented 1 year ago

ditto

agustiza commented 1 year ago

Apache commons-codec for example throws a checked DecoderException https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/binary/Hex.java#L73

Should jpos hex2byte throw? Should it be a checked or an unchecked exception?

I'd go for a checked exception if breaking backward compatibility is not an issue. If not maybe an unchecked IllegalArgumentException