From b9c12d44c3d8e5697d892c2938fe4e031c90a137 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Fri, 21 Dec 2018 12:05:14 +0100 Subject: [PATCH] Use InetSocketAddress in log message in XMPPTCPConnection The inetAddressAndPort String is redundant since a2743549b8a4126e17f61adcb369f72d86ef58e1, because we now construct the InetSocketAddress earlier and can hence use it in the log statement. --- .../java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index 5d940a679..24fcf37bc 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -583,9 +583,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { SmackFuture.SocketFuture socketFuture = new SmackFuture.SocketFuture(socketFactory); final InetAddress inetAddress = inetAddresses.next(); - final String inetAddressAndPort = inetAddress + " at port " + port; final InetSocketAddress inetSocketAddress = new InetSocketAddress(inetAddress, port); - LOGGER.finer("Trying to establish TCP connection to " + inetAddressAndPort); + LOGGER.finer("Trying to establish TCP connection to " + inetSocketAddress); socketFuture.connectAsync(inetSocketAddress, timeout); try { @@ -598,7 +597,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { break innerloop; } } - LOGGER.finer("Established TCP connection to " + inetAddressAndPort); + LOGGER.finer("Established TCP connection to " + inetSocketAddress); // We found a host to connect to, return here this.host = host; this.port = port;