From 2cd7bbadc56c1c51d08dd027277c935042410499 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 26 Apr 2014 18:13:33 +0200 Subject: [PATCH] Remove try/catch in startTLSReceived as exceptions are catched further up the call stack. --- .../org/jivesoftware/smack/XMPPTCPConnection.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tcp/src/main/java/org/jivesoftware/smack/XMPPTCPConnection.java b/tcp/src/main/java/org/jivesoftware/smack/XMPPTCPConnection.java index f5f10596d..91d8e3e63 100644 --- a/tcp/src/main/java/org/jivesoftware/smack/XMPPTCPConnection.java +++ b/tcp/src/main/java/org/jivesoftware/smack/XMPPTCPConnection.java @@ -615,8 +615,9 @@ public class XMPPTCPConnection extends XMPPConnection { * want to secure the connection. * * @param required true when the server indicates that TLS is required. + * @throws IOException if an exception occurs. */ - void startTLSReceived(boolean required) { + void startTLSReceived(boolean required) throws IOException { if (required && config.getSecurityMode() == ConnectionConfiguration.SecurityMode.disabled) { notifyConnectionError(new IllegalStateException( @@ -628,13 +629,8 @@ public class XMPPTCPConnection extends XMPPConnection { // Do not secure the connection using TLS since TLS was disabled return; } - try { - writer.write(""); - writer.flush(); - } - catch (IOException e) { - notifyConnectionError(e); - } + writer.write(""); + writer.flush(); } /**