diff --git a/server/src/main/java/com/linbit/linstor/netcom/TcpConnectorService.java b/server/src/main/java/com/linbit/linstor/netcom/TcpConnectorService.java index a9903568c..537a92b8b 100644 --- a/server/src/main/java/com/linbit/linstor/netcom/TcpConnectorService.java +++ b/server/src/main/java/com/linbit/linstor/netcom/TcpConnectorService.java @@ -997,7 +997,7 @@ protected void establishConnection(SelectionKey currentKey) String localAddrText = null; String remoteAddrText = null; - try + if (localAddr instanceof InetSocketAddress) { final InetSocketAddress localInetAddr = (InetSocketAddress) localAddr; final InetAddress ipAddress = localInetAddr.getAddress(); @@ -1006,12 +1006,8 @@ protected void establishConnection(SelectionKey currentKey) localAddrText = ipAddress.getHostAddress(); } } - catch (ClassCastException ignored) - { - // ignored - } - try + if (remoteAddr instanceof InetSocketAddress) { final InetSocketAddress remoteInetAddr = (InetSocketAddress) remoteAddr; final InetAddress ipAddress = remoteInetAddr.getAddress(); @@ -1020,10 +1016,6 @@ protected void establishConnection(SelectionKey currentKey) remoteAddrText = ipAddress.getHostAddress(); } } - catch (ClassCastException ignored) - { - // ignored - } final String errorDescription = this.getServiceName() + " connector: Connection " +