mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 17:19:39 +02:00
Add errorprone check and fix found errors
Adds gradle-errorprone-plugin 0.0.8, requires Gradle 2.6.
This commit is contained in:
parent
8096da43e0
commit
d728204890
23 changed files with 64 additions and 44 deletions
|
@ -100,6 +100,8 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
*/
|
||||
protected String sessionID = null;
|
||||
|
||||
private boolean notified;
|
||||
|
||||
/**
|
||||
* Create a HTTP Binding connection to an XMPP server.
|
||||
*
|
||||
|
@ -135,6 +137,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
@Override
|
||||
protected void connectInternal() throws SmackException, InterruptedException {
|
||||
done = false;
|
||||
notified = false;
|
||||
try {
|
||||
// Ensure a clean starting state
|
||||
if (client != null) {
|
||||
|
@ -179,10 +182,12 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
// Wait for the response from the server
|
||||
synchronized (this) {
|
||||
if (!connected) {
|
||||
try {
|
||||
wait(getPacketReplyTimeout());
|
||||
final long deadline = System.currentTimeMillis() + getPacketReplyTimeout();
|
||||
while (!notified) {
|
||||
final long now = System.currentTimeMillis();
|
||||
if (now > deadline) break;
|
||||
wait(deadline - now);
|
||||
}
|
||||
catch (InterruptedException e) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -439,6 +444,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
}
|
||||
finally {
|
||||
notified = true;
|
||||
synchronized (XMPPBOSHConnection.this) {
|
||||
XMPPBOSHConnection.this.notifyAll();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue