From 0f247cf30e99dc63d4d2f8045270a139242df4ab Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 22 Jun 2013 17:02:09 +0000 Subject: [PATCH] SMACK-405 Removed redundant code in XMPPConnection.shutdown() git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_1@13690 b35dd754-fafc-0310-a699-88a17e54d16e --- .../jivesoftware/smack/XMPPConnection.java | 42 ++++--------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index f0b6eafd8..494b8b42c 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -443,48 +443,22 @@ public class XMPPConnection extends Connection { // Ignore. } - // Set socketClosed to true. This will cause the PacketReader - // and PacketWriter to ingore any Exceptions that are thrown - // because of a read/write from/to a closed stream. - // It is *important* that this is done before socket.close()! + // Set socketClosed to true. This will cause the PacketReader + // and PacketWriter to ignore any Exceptions that are thrown + // because of a read/write from/to a closed stream. + // It is *important* that this is done before socket.close()! socketClosed = true; try { socket.close(); } catch (Exception e) { e.printStackTrace(); } - // In most cases the close() should be successful, so set - // connected to false here. + // In most cases the close() should be successful, so set + // connected to false here. connected = false; - // Close down the readers and writers. - if (reader != null) { - try { - // Should already be closed by the previous - // socket.close(). But just in case do it explicitly. - reader.close(); - } - catch (Throwable ignore) { /* ignore */ } - reader = null; - } - if (writer != null) { - try { - // Should already be closed by the previous - // socket.close(). But just in case do it explicitly. - writer.close(); - } - catch (Throwable ignore) { /* ignore */ } - writer = null; - } - - // Make sure that the socket is really closed - try { - // Does nothing if the socket is already closed - socket.close(); - } - catch (Exception e) { - // Ignore. - } + reader = null; + writer = null; saslAuthentication.init(); }