From 84e1f32284cd135ad86f66de04ab36329236379f Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 2 Nov 2013 11:46:21 +0000 Subject: [PATCH] SMACK-339 Allow ConnectionListeners to be added before Connection is connected git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_2@13798 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/Connection.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/org/jivesoftware/smack/Connection.java b/source/org/jivesoftware/smack/Connection.java index ced103f22..d1d9cd41b 100644 --- a/source/org/jivesoftware/smack/Connection.java +++ b/source/org/jivesoftware/smack/Connection.java @@ -527,15 +527,11 @@ public abstract class Connection { /** * Adds a connection listener to this connection that will be notified when - * the connection closes or fails. The connection needs to already be connected - * or otherwise an IllegalStateException will be thrown. + * the connection closes or fails. * * @param connectionListener a connection listener. */ public void addConnectionListener(ConnectionListener connectionListener) { - if (!isConnected()) { - throw new IllegalStateException("Not connected to server."); - } if (connectionListener == null) { return; }