1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-08 22:21:08 +01:00

Add errorprone check and fix found errors

Adds gradle-errorprone-plugin 0.0.8, requires Gradle 2.6.
This commit is contained in:
Florian Schmaus 2015-09-13 18:12:33 +02:00
parent 8096da43e0
commit d728204890
23 changed files with 64 additions and 44 deletions

View file

@ -75,7 +75,6 @@ class Socks5Client {
*/
public Socket getSocket(int timeout) throws IOException, XMPPErrorException, InterruptedException,
TimeoutException, SmackException, XMPPException {
// wrap connecting in future for timeout
FutureTask<Socket> futureTask = new FutureTask<Socket>(new Callable<Socket>() {

View file

@ -38,7 +38,7 @@ public class OfflineMessageRequest extends IQ {
public static final String ELEMENT = "offline";
public static final String NAMESPACE = "http://jabber.org/protocol/offline";
private List<Item> items = new ArrayList<Item>();
private final List<Item> items = new ArrayList<>();
private boolean purge = false;
private boolean fetch = false;

View file

@ -70,7 +70,7 @@ public class DataForm implements ExtensionElement {
private Type type;
private String title;
private List<String> instructions = new ArrayList<String>();
private final List<String> instructions = new ArrayList<>();
private ReportedData reportedData;
private final List<Item> items = new ArrayList<Item>();
private final Map<String, FormField> fields = new LinkedHashMap<>();
@ -197,7 +197,10 @@ public class DataForm implements ExtensionElement {
* @param instructions list of instructions that explain how to fill out the form.
*/
public void setInstructions(List<String> instructions) {
this.instructions = instructions;
synchronized (this.instructions) {
this.instructions.clear();
this.instructions.addAll(instructions);
}
}
/**

View file

@ -40,7 +40,7 @@ public class XHTMLExtension implements ExtensionElement {
public static final String ELEMENT = "html";
public static final String NAMESPACE = "http://jabber.org/protocol/xhtml-im";
private List<CharSequence> bodies = new ArrayList<CharSequence>();
private final List<CharSequence> bodies = new ArrayList<>();
/**
* Returns the XML element name of the extension sub-packet root element.