From d295939285031c14f33177bf5fd3e9b79cd6f4c0 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 28 Dec 2014 17:46:47 +0100 Subject: [PATCH] Remove connection field from BOSHConnectionListener --- .../smack/bosh/XMPPBOSHConnection.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java b/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java index dc8d16945..edd2d4800 100644 --- a/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java +++ b/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java @@ -161,7 +161,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { } client = BOSHClient.create(cfgBuilder.build()); - client.addBOSHClientConnListener(new BOSHConnectionListener(this)); + client.addBOSHClientConnListener(new BOSHConnectionListener()); client.addBOSHClientResponseListener(new BOSHPacketReader()); // Initialize the debugger @@ -459,12 +459,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { */ private class BOSHConnectionListener implements BOSHClientConnListener { - private final XMPPBOSHConnection connection; - - public BOSHConnectionListener(XMPPBOSHConnection connection) { - this.connection = connection; - } - /** * Notify the BOSHConnection about connection state changes. * Process the connection listeners and try to login if the @@ -477,13 +471,13 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { if (isFirstInitialization) { isFirstInitialization = false; for (ConnectionCreationListener listener : getConnectionCreationListeners()) { - listener.connectionCreated(connection); + listener.connectionCreated(XMPPBOSHConnection.this); } } else { try { if (wasAuthenticated) { - connection.login(); + login(); } for (ConnectionListener listener : getConnectionListeners()) { listener.reconnectionSuccessful(); @@ -513,8 +507,8 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { } } finally { - synchronized (connection) { - connection.notifyAll(); + synchronized (XMPPBOSHConnection.this) { + XMPPBOSHConnection.this.notifyAll(); } } }