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 4d85da2f7..1e48c72c4 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 @@ -185,7 +185,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { final long deadline = System.currentTimeMillis() + getPacketReplyTimeout(); while (!notified) { final long now = System.currentTimeMillis(); - if (now > deadline) break; + if (now >= deadline) break; wait(deadline - now); } } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java b/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java index ca11f21a1..024a7ef9e 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java @@ -203,7 +203,7 @@ public final class SASLAuthentication { final long deadline = System.currentTimeMillis() + connection.getPacketReplyTimeout(); while (!authenticationSuccessful && saslException == null) { final long now = System.currentTimeMillis(); - if (now > deadline) break; + if (now >= deadline) break; // Wait until SASL negotiation finishes wait(deadline - now); } diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/ResultSyncPoint.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/ResultSyncPoint.java index 475f7f059..71c907781 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/ResultSyncPoint.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/ResultSyncPoint.java @@ -36,7 +36,7 @@ public class ResultSyncPoint { final long deadline = System.currentTimeMillis() + timeout; while (result == null && exception == null) { final long now = System.currentTimeMillis(); - if (now > deadline) break; + if (now >= deadline) break; wait(deadline - now); } }