mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
Update errorprone(-plugin) and make Unused(Variable|Method) an error
This commit is contained in:
parent
68d7d738b6
commit
7f0dc72dab
46 changed files with 81 additions and 126 deletions
|
@ -329,6 +329,21 @@ public class StanzaCollector implements AutoCloseable {
|
|||
return resultQueue.size();
|
||||
}
|
||||
|
||||
private String stringCache;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (stringCache == null) {
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
sb.append("Stanza Collector filter='").append(packetFilter).append('\'');
|
||||
if (request != null) {
|
||||
sb.append(" request='").append(request).append('\'');
|
||||
}
|
||||
stringCache = sb.toString();
|
||||
}
|
||||
return stringCache;
|
||||
}
|
||||
|
||||
synchronized void notifyConnectionError(Exception exception) {
|
||||
connectionException = exception;
|
||||
notifyAll();
|
||||
|
|
|
@ -73,7 +73,6 @@ public class Socks4ProxySocketConnection implements ProxySocketConnection {
|
|||
of all zero bits.
|
||||
*/
|
||||
|
||||
index = 0;
|
||||
buf[index++] = 4;
|
||||
buf[index++] = 1;
|
||||
|
||||
|
|
|
@ -368,6 +368,7 @@ public class PacketParserUtils {
|
|||
return xml;
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
private static CharSequence parseContentDepthWithRoundtrip(XmlPullParser parser, int depth, boolean fullNamespaces)
|
||||
throws XmlPullParserException, IOException {
|
||||
XmlStringBuilder sb = new XmlStringBuilder();
|
||||
|
|
|
@ -51,6 +51,7 @@ public class MemoryLeakTestUtil {
|
|||
|
||||
private static final Logger LOGGER = Logger.getLogger(MemoryLeakTestUtil.class.getName());
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public static <M extends Manager> void noResourceLeakTest(Function<DummyConnection, M> managerSupplier)
|
||||
throws XmppStringprepException, IllegalArgumentException, InterruptedException {
|
||||
final int numConnections = 10;
|
||||
|
@ -119,6 +120,7 @@ public class MemoryLeakTestUtil {
|
|||
assertNull(reference);
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
private static void triggerGarbageCollection() {
|
||||
Object object = new Object();
|
||||
WeakReference<Object> weakReference = new WeakReference<>(object);
|
||||
|
|
|
@ -31,11 +31,9 @@ import org.junit.Test;
|
|||
public class StringUtilsTest {
|
||||
@Test
|
||||
public void testEscapeForXml() {
|
||||
String input = null;
|
||||
|
||||
assertNull(StringUtils.escapeForXml(null));
|
||||
|
||||
input = "<b>";
|
||||
String input = "<b>";
|
||||
assertCharSequenceEquals("<b>", StringUtils.escapeForXml(input));
|
||||
|
||||
input = "\"";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue