InetAddresses: unwrap reflection exceptions

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-07-16 15:05:04 +02:00
parent 71cf39660f
commit 04ff63f1b5

View File

@ -34,7 +34,7 @@ public final class InetAddresses {
try {
return (InetAddress) PARSER_METHOD.invoke(null, address);
} catch (final IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new RuntimeException(e.getCause() == null ? e : e.getCause());
}
}
}