From 8736e3e4345ad49e2e922e999770cdd31c10a1e5 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Fri, 5 Nov 2021 10:19:26 +0100 Subject: [PATCH] [core] Remove erroneous "assert !connected" in connect() Connections like XMPPTCPConnection may still reported connected, if they are, for example disconnected but resumable. This is already accounted for in throwAlreadyConnectedExceptionIfAppropriate(), hence the assert is unnecessary and leads to false negatives for XMPPTCPConnection. For the sake of completeness, the right condition, assuming XMPPTCPConnection is used, for the assert would be: assert !connected || disconnectedButResumable; --- .../java/org/jivesoftware/smack/AbstractXMPPConnection.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java index 0c2c59a14..3f913120e 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java @@ -521,9 +521,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { closingStreamReceived = false; streamId = null; - // The connection should not be connected nor marked as such prior calling connectInternal(). - assert !connected; - try { // Perform the actual connection to the XMPP service connectInternal();