From edcbb15a07ecaac194d7cb968b246ab5cd4fe4e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 23 May 2009 17:19:55 +0200 Subject: [PATCH] Throw more appropriate exception. --- src/net/pterodactylus/util/number/Hex.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/pterodactylus/util/number/Hex.java b/src/net/pterodactylus/util/number/Hex.java index 3f6145f..f92a31a 100644 --- a/src/net/pterodactylus/util/number/Hex.java +++ b/src/net/pterodactylus/util/number/Hex.java @@ -72,7 +72,7 @@ public class Hex { public static byte[] toByte(String hexString) { if ((hexString.length() & 0x01) == 0x01) { /* odd length, this is not correct. */ - throw new IllegalArgumentException("hex string must have even length."); + throw new NumberFormatException("hex string must have even length."); } byte[] dataBytes = new byte[hexString.length() / 2]; for (int stringIndex = 0; stringIndex < hexString.length(); stringIndex += 2) { -- 2.7.4