mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +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
|
@ -192,8 +192,13 @@ public final class SASLAuthentication {
|
|||
else {
|
||||
currentMechanism.authenticate(username, host, xmppServiceDomain, password);
|
||||
}
|
||||
// Wait until SASL negotiation finishes
|
||||
wait(connection.getPacketReplyTimeout());
|
||||
final long deadline = System.currentTimeMillis() + connection.getPacketReplyTimeout();
|
||||
while (!authenticationSuccessful && saslException == null) {
|
||||
final long now = System.currentTimeMillis();
|
||||
if (now > deadline) break;
|
||||
// Wait until SASL negotiation finishes
|
||||
wait(deadline - now);
|
||||
}
|
||||
}
|
||||
|
||||
if (saslException != null){
|
||||
|
|
|
@ -71,7 +71,12 @@ class HTTPProxySocketConnection implements ProxySocketConnection {
|
|||
|
||||
while (true)
|
||||
{
|
||||
char c = (char) in.read();
|
||||
int inByte = in.read();
|
||||
if (inByte == -1)
|
||||
{
|
||||
throw new ProxyException(ProxyInfo.ProxyType.HTTP);
|
||||
}
|
||||
char c = (char) inByte;
|
||||
got.append(c);
|
||||
if (got.length() > 1024)
|
||||
{
|
||||
|
@ -79,10 +84,6 @@ class HTTPProxySocketConnection implements ProxySocketConnection {
|
|||
"header of >1024 characters from "
|
||||
+ proxyhost + ", cancelling connection");
|
||||
}
|
||||
if (c == -1)
|
||||
{
|
||||
throw new ProxyException(ProxyInfo.ProxyType.HTTP);
|
||||
}
|
||||
if ((nlchars == 0 || nlchars == 2) && c == '\r')
|
||||
{
|
||||
nlchars++;
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
public class ObservableReader extends Reader {
|
||||
|
||||
Reader wrappedReader = null;
|
||||
List<ReaderListener> listeners = new ArrayList<ReaderListener>();
|
||||
final List<ReaderListener> listeners = new ArrayList<ReaderListener>();
|
||||
|
||||
public ObservableReader(Reader wrappedReader) {
|
||||
this.wrappedReader = wrappedReader;
|
||||
|
|
|
@ -31,7 +31,7 @@ public class ObservableWriter extends Writer {
|
|||
private static final int MAX_STRING_BUILDER_SIZE = 4096;
|
||||
|
||||
Writer wrappedWriter = null;
|
||||
List<WriterListener> listeners = new ArrayList<WriterListener>();
|
||||
final List<WriterListener> listeners = new ArrayList<WriterListener>();
|
||||
private final StringBuilder stringBuilder = new StringBuilder(MAX_STRING_BUILDER_SIZE);
|
||||
|
||||
public ObservableWriter(Writer wrappedWriter) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue