1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Bump "Error Prone" to 2.3.2

and gradle-errorprone-plugin to 0.6.
This commit is contained in:
Florian Schmaus 2018-10-31 16:06:31 +01:00
parent ec7badfda0
commit b7ea226c56
65 changed files with 173 additions and 149 deletions

View file

@ -1128,8 +1128,8 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
// If the IQ stanza is of type "get" or "set" with no registered IQ request handler, then answer an
// IQ of type 'error' with condition 'service-unavailable'.
ErrorIQ errorIQ = IQ.createErrorResponse(iq, StanzaError.getBuilder((
replyCondition)));
ErrorIQ errorIQ = IQ.createErrorResponse(iq, StanzaError.getBuilder(
replyCondition));
try {
sendStanza(errorIQ);
}

View file

@ -55,6 +55,7 @@ public class SynchronizationPoint<E extends Exception> {
/**
* Initialize (or reset) this synchronization point.
*/
@SuppressWarnings("LockNotBeforeTry")
public void init() {
connectionLock.lock();
state = State.Initial;

View file

@ -41,10 +41,10 @@ public class StanzaIdFilter implements StanzaFilter {
/**
* Creates a new stanza ID filter using the specified stanza ID.
*
* @param stanzaID the stanza ID to filter for.
* @param stanzaId the stanza ID to filter for.
*/
public StanzaIdFilter(String stanzaID) {
this.stanzaId = StringUtils.requireNotNullNorEmpty(stanzaID, "Stanza ID must not be null nor empty.");
public StanzaIdFilter(String stanzaId) {
this.stanzaId = StringUtils.requireNotNullNorEmpty(stanzaId, "Stanza ID must not be null nor empty.");
}
@Override

View file

@ -21,7 +21,6 @@ import java.util.LinkedHashMap;
import java.util.Map;
import org.jivesoftware.smack.packet.StandardExtensionElement;
import org.jivesoftware.smack.packet.StandardExtensionElement.Builder;
import org.jivesoftware.smack.provider.ExtensionElementProvider;
import org.jivesoftware.smack.util.ParserUtils;
import org.jivesoftware.smack.util.StringUtils;
@ -46,7 +45,7 @@ public class StandardExtensionElementProvider extends ExtensionElementProvider<S
// we are parsing here.
String name = parser.getName();
String namespace = parser.getNamespace();
Builder builder = StandardExtensionElement.builder(name, namespace);
StandardExtensionElement.Builder builder = StandardExtensionElement.builder(name, namespace);
final int namespaceCount = parser.getNamespaceCount(initialDepth);
final int attributeCount = parser.getAttributeCount();
final Map<String, String> attributes = new LinkedHashMap<>(namespaceCount + attributeCount);

View file

@ -102,7 +102,7 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
fill(in, buf, 2);
boolean check = false;
switch ((buf[1]) & 0xff) {
switch (buf[1] & 0xff) {
case 0: // NO AUTHENTICATION REQUIRED
check = true;
break;
@ -132,13 +132,13 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
*/
index = 0;
buf[index++] = 1;
buf[index++] = (byte) (user.length());
buf[index++] = (byte) user.length();
byte[] userBytes = user.getBytes(StringUtils.UTF8);
System.arraycopy(userBytes, 0, buf, index,
user.length());
index += user.length();
byte[] passwordBytes = passwd.getBytes(StringUtils.UTF8);
buf[index++] = (byte) (passwordBytes.length);
buf[index++] = (byte) passwordBytes.length;
System.arraycopy(passwordBytes, 0, buf, index,
passwd.length());
index += passwd.length();
@ -207,7 +207,7 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
byte[] hostb = host.getBytes(StringUtils.UTF8);
int len = hostb.length;
buf[index++] = 3; // DOMAINNAME
buf[index++] = (byte) (len);
buf[index++] = (byte) len;
System.arraycopy(hostb, 0, buf, index, len);
index += len;
buf[index++] = (byte) (port >>> 8);

View file

@ -36,7 +36,7 @@ public class SCRAMSHA1Mechanism extends ScramMechanism {
return MAC.hmacsha1(key, str);
}
};
NAME = (new SCRAMSHA1Mechanism()).getName();
NAME = new SCRAMSHA1Mechanism().getName();
}
public static final String NAME;

View file

@ -21,7 +21,7 @@ import org.jivesoftware.smack.sasl.SASLMechanism;
public class ScramSha1PlusMechanism extends ScramPlusMechanism {
static {
NAME = (new ScramSha1PlusMechanism()).getName();
NAME = new ScramSha1PlusMechanism().getName();
}
public static final String NAME;

View file

@ -20,7 +20,6 @@ import static org.jivesoftware.smack.util.PacketParserUtils.getParserFor;
import static org.junit.Assert.assertEquals;
import org.jivesoftware.smack.packet.StandardExtensionElement;
import org.jivesoftware.smack.packet.StandardExtensionElement.Builder;
import org.junit.Test;
@ -28,7 +27,7 @@ public class StandardExtensionElementParserTest {
@Test
public void buildAndParse() throws Exception {
Builder builder = StandardExtensionElement.builder("foo", "ns1");
StandardExtensionElement.Builder builder = StandardExtensionElement.builder("foo", "ns1");
builder.addAttribute("attr1", "attr1-value");
builder.addElement(StandardExtensionElement.builder("bar", "ns2").addAttribute("attr2", "attr2-value").build());
builder.addElement("another-element", "another-element-text");
@ -53,7 +52,7 @@ public class StandardExtensionElementParserTest {
@Test
public void buildWithAttrNamespacesAndParse() throws Exception {
Builder builder = StandardExtensionElement.builder("foo", "ns1-value");
StandardExtensionElement.Builder builder = StandardExtensionElement.builder("foo", "ns1-value");
builder.addAttribute("xmlns:ns2", "ns2-value");
builder.addAttribute("ns2:bar", "bar-ns2-value");
final String elementString = builder.build().toXML(null).toString();

View file

@ -813,7 +813,7 @@ public class PacketParserUtilsTest {
final String stanza = "<iq type='result' to='foo@bar.com' from='baz.com' id='42'/>";
XmlPullParser parser = TestUtils.getParser(stanza, "iq");
CharSequence content = PacketParserUtils.parseContent(parser);
assertEquals("", content);
assertEquals("", content.toString());
}
@Test