From 8bfc43a332d5573397b72b778fed2b8c13d1dfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kohlschu=CC=88tter?= Date: Wed, 26 Oct 2022 10:00:44 +0200 Subject: [PATCH] Fix PMD warning --- .../src/main/java/org/newsclub/net/unix/AFInetAddress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/junixsocket-common/src/main/java/org/newsclub/net/unix/AFInetAddress.java b/junixsocket-common/src/main/java/org/newsclub/net/unix/AFInetAddress.java index b8645760b..311e428d6 100644 --- a/junixsocket-common/src/main/java/org/newsclub/net/unix/AFInetAddress.java +++ b/junixsocket-common/src/main/java/org/newsclub/net/unix/AFInetAddress.java @@ -181,8 +181,8 @@ static final byte[] unwrapAddress(InetAddress addr, AFAddressFamily af) String hostname = addr.getHostName(); try { return unwrapAddress(hostname, af); - } catch (IllegalStateException | IllegalArgumentException e) { - throw new SocketException("Unsupported address"); + } catch (IllegalArgumentException e) { + throw (SocketException)new SocketException("Unsupported address").initCause(e); } }