Update Error Prone to 2.0.18

and update errorprone-plugin to 0.0.9.
This commit is contained in:
Florian Schmaus 2017-03-06 17:17:15 +01:00
parent 52a52e12d2
commit c81f28a3a2
11 changed files with 61 additions and 18 deletions

View File

@ -10,7 +10,7 @@ buildscript {
classpath 'org.kordamp:markdown-gradle-plugin:1.0.0' classpath 'org.kordamp:markdown-gradle-plugin:1.0.0'
classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.0' classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.0'
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.3.1" classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.3.1"
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8' classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.9'
} }
} }
apply plugin: 'org.kordamp.gradle.markdown' apply plugin: 'org.kordamp.gradle.markdown'
@ -170,7 +170,7 @@ allprojects {
// version 52.0" error messages caused by the errorprone javac. // version 52.0" error messages caused by the errorprone javac.
// See https://github.com/tbroyer/gradle-errorprone-plugin/issues/18 for more information. // See https://github.com/tbroyer/gradle-errorprone-plugin/issues/18 for more information.
configurations.errorprone { configurations.errorprone {
resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.15' resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.18'
} }
} }

View File

@ -1481,6 +1481,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
getReplyTimeout()); getReplyTimeout());
} }
@SuppressWarnings("FutureReturnValueIgnored")
@Override @Override
public void sendStanzaWithResponseCallback(Stanza stanza, final StanzaFilter replyFilter, public void sendStanzaWithResponseCallback(Stanza stanza, final StanzaFilter replyFilter,
final StanzaListener callback, final ExceptionCallback exceptionCallback, final StanzaListener callback, final ExceptionCallback exceptionCallback,
@ -1553,6 +1554,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
sendStanzaWithResponseCallback(iqRequest, replyFilter, callback, exceptionCallback, timeout); sendStanzaWithResponseCallback(iqRequest, replyFilter, callback, exceptionCallback, timeout);
} }
@SuppressWarnings("FutureReturnValueIgnored")
@Override @Override
public void addOneTimeSyncCallback(final StanzaListener callback, final StanzaFilter packetFilter) { public void addOneTimeSyncCallback(final StanzaListener callback, final StanzaFilter packetFilter) {
final StanzaListener packetListener = new StanzaListener() { final StanzaListener packetListener = new StanzaListener() {

View File

@ -594,7 +594,7 @@ abstract public class Node
* *
* @author Robin Collier * @author Robin Collier
*/ */
public class ItemEventTranslator implements StanzaListener public static class ItemEventTranslator implements StanzaListener
{ {
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
private ItemEventListener listener; private ItemEventListener listener;
@ -623,7 +623,7 @@ abstract public class Node
* *
* @author Robin Collier * @author Robin Collier
*/ */
public class ItemDeleteTranslator implements StanzaListener public static class ItemDeleteTranslator implements StanzaListener
{ {
private ItemDeleteListener listener; private ItemDeleteListener listener;

View File

@ -387,7 +387,7 @@ public class ChatConnectionTest {
} }
} }
private class TestMessageListener implements ChatMessageListener { private static class TestMessageListener implements ChatMessageListener {
private Chat msgChat; private Chat msgChat;
private int counter = 0; private int counter = 0;

View File

@ -103,6 +103,7 @@ public class JMFInit extends Frame implements Runnable {
} }
} }
@SuppressWarnings("LiteralClassName")
private void detectCaptureDevices() { private void detectCaptureDevices() {
// check if JavaSound capture is available // check if JavaSound capture is available
message("Looking for Audio capturer"); message("Looking for Audio capturer");

View File

@ -38,6 +38,7 @@ import org.xmlpull.v1.XmlPullParserException;
*/ */
public class AgentStatus implements ExtensionElement { public class AgentStatus implements ExtensionElement {
@SuppressWarnings("SimpleDateFormatConstant")
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss"); private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
static { static {
@ -206,7 +207,11 @@ public class AgentStatus implements ExtensionElement {
buf.append(" userID=\"").append(userID).append('"'); buf.append(" userID=\"").append(userID).append('"');
} }
if (date != null) { if (date != null) {
buf.append(" startTime=\"").append(UTC_FORMAT.format(date)).append('"'); buf.append(" startTime=\"");
synchronized (UTC_FORMAT) {
buf.append(UTC_FORMAT.format(date));
}
buf.append('"');
} }
if (email != null) { if (email != null) {
buf.append(" email=\"").append(email).append('"'); buf.append(" email=\"").append(email).append('"');
@ -260,7 +265,9 @@ public class AgentStatus implements ExtensionElement {
String userID = parser.getAttributeValue("", "userID"); String userID = parser.getAttributeValue("", "userID");
Date date = null; Date date = null;
try { try {
date = UTC_FORMAT.parse(parser.getAttributeValue("", "startTime")); synchronized (UTC_FORMAT) {
date = UTC_FORMAT.parse(parser.getAttributeValue("", "startTime"));
}
} }
catch (ParseException e) { catch (ParseException e) {
} }

View File

@ -40,6 +40,7 @@ import org.xmlpull.v1.XmlPullParserException;
*/ */
public class OccupantsInfo extends IQ { public class OccupantsInfo extends IQ {
@SuppressWarnings("SimpleDateFormatConstant")
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss"); private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
static { static {
@ -93,7 +94,9 @@ public class OccupantsInfo extends IQ {
buf.append("</name>"); buf.append("</name>");
// Add the date when the occupant joined the room // Add the date when the occupant joined the room
buf.append("<joined>"); buf.append("<joined>");
buf.append(UTC_FORMAT.format(occupant.getJoined())); synchronized (UTC_FORMAT) {
buf.append(UTC_FORMAT.format(occupant.getJoined()));
}
buf.append("</joined>"); buf.append("</joined>");
buf.append("</occupant>"); buf.append("</occupant>");
} }
@ -165,7 +168,9 @@ public class OccupantsInfo extends IQ {
} else if ((eventType == XmlPullParser.START_TAG) && } else if ((eventType == XmlPullParser.START_TAG) &&
("joined".equals(parser.getName()))) { ("joined".equals(parser.getName()))) {
try { try {
joined = UTC_FORMAT.parse(parser.nextText()); synchronized (UTC_FORMAT) {
joined = UTC_FORMAT.parse(parser.nextText());
}
} catch (ParseException e) { } catch (ParseException e) {
throw new SmackException(e); throw new SmackException(e);
} }

View File

@ -36,6 +36,7 @@ import org.jxmpp.jid.Jid;
*/ */
public class Transcripts extends IQ { public class Transcripts extends IQ {
@SuppressWarnings("SimpleDateFormatConstant")
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss"); private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
static { static {
UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+0")); UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+0"));
@ -169,10 +170,18 @@ public class Transcripts extends IQ {
.append("\">"); .append("\">");
if (joinTime != null) { if (joinTime != null) {
buf.append("<joinTime>").append(UTC_FORMAT.format(joinTime)).append("</joinTime>"); buf.append("<joinTime>");
synchronized (UTC_FORMAT) {
buf.append(UTC_FORMAT.format(joinTime));
}
buf.append("</joinTime>");
} }
if (leftTime != null) { if (leftTime != null) {
buf.append("<leftTime>").append(UTC_FORMAT.format(leftTime)).append("</leftTime>"); buf.append("<leftTime>");
synchronized (UTC_FORMAT) {
buf.append(UTC_FORMAT.format(leftTime));
}
buf.append("</leftTime>");
} }
buf.append("<agents>"); buf.append("<agents>");
for (AgentDetail agentDetail : agentDetails) { for (AgentDetail agentDetail : agentDetails) {
@ -234,10 +243,18 @@ public class Transcripts extends IQ {
buf.append("<agentJID>").append(agentJID).append("</agentJID>"); buf.append("<agentJID>").append(agentJID).append("</agentJID>");
} }
if (joinTime != null) { if (joinTime != null) {
buf.append("<joinTime>").append(UTC_FORMAT.format(joinTime)).append("</joinTime>"); buf.append("<joinTime>");
synchronized (UTC_FORMAT) {
buf.append(UTC_FORMAT.format(joinTime));
}
buf.append("</joinTime>");
} }
if (leftTime != null) { if (leftTime != null) {
buf.append("<leftTime>").append(UTC_FORMAT.format(leftTime)).append("</leftTime>"); buf.append("<leftTime>");
synchronized (UTC_FORMAT) {
buf.append(UTC_FORMAT.format(leftTime));
}
buf.append("</leftTime>");
} }
buf.append("</agent>"); buf.append("</agent>");

View File

@ -38,6 +38,7 @@ import java.util.TimeZone;
*/ */
public class TranscriptsProvider extends IQProvider<Transcripts> { public class TranscriptsProvider extends IQProvider<Transcripts> {
@SuppressWarnings("SimpleDateFormatConstant")
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss"); private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
static { static {
UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+0")); UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+0"));
@ -79,12 +80,16 @@ public class TranscriptsProvider extends IQProvider<Transcripts> {
if (eventType == XmlPullParser.START_TAG) { if (eventType == XmlPullParser.START_TAG) {
if (parser.getName().equals("joinTime")) { if (parser.getName().equals("joinTime")) {
try { try {
joinTime = UTC_FORMAT.parse(parser.nextText()); synchronized (UTC_FORMAT) {
joinTime = UTC_FORMAT.parse(parser.nextText());
}
} catch (ParseException e) {} } catch (ParseException e) {}
} }
else if (parser.getName().equals("leftTime")) { else if (parser.getName().equals("leftTime")) {
try { try {
leftTime = UTC_FORMAT.parse(parser.nextText()); synchronized (UTC_FORMAT) {
leftTime = UTC_FORMAT.parse(parser.nextText());
}
} catch (ParseException e) {} } catch (ParseException e) {}
} }
else if (parser.getName().equals("agents")) { else if (parser.getName().equals("agents")) {
@ -116,12 +121,16 @@ public class TranscriptsProvider extends IQProvider<Transcripts> {
} }
else if (parser.getName().equals("joinTime")) { else if (parser.getName().equals("joinTime")) {
try { try {
joinTime = UTC_FORMAT.parse(parser.nextText()); synchronized (UTC_FORMAT) {
joinTime = UTC_FORMAT.parse(parser.nextText());
}
} catch (ParseException e) {} } catch (ParseException e) {}
} }
else if (parser.getName().equals("leftTime")) { else if (parser.getName().equals("leftTime")) {
try { try {
leftTime = UTC_FORMAT.parse(parser.nextText()); synchronized (UTC_FORMAT) {
leftTime = UTC_FORMAT.parse(parser.nextText());
}
} catch (ParseException e) {} } catch (ParseException e) {}
} }
else if (parser.getName().equals("agent")) { else if (parser.getName().equals("agent")) {

View File

@ -681,6 +681,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
* @throws SmackException * @throws SmackException
* @throws Exception if an exception occurs. * @throws Exception if an exception occurs.
*/ */
@SuppressWarnings("LiteralClassName")
private void proceedTLSReceived() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, NoSuchProviderException, UnrecoverableKeyException, KeyManagementException, SmackException { private void proceedTLSReceived() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, NoSuchProviderException, UnrecoverableKeyException, KeyManagementException, SmackException {
SSLContext context = this.config.getCustomSSLContext(); SSLContext context = this.config.getCustomSSLContext();
KeyStore ks = null; KeyStore ks = null;
@ -1710,6 +1711,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
* @return the previous listener for this stanza ID or null. * @return the previous listener for this stanza ID or null.
* @throws StreamManagementNotEnabledException if Stream Management is not enabled. * @throws StreamManagementNotEnabledException if Stream Management is not enabled.
*/ */
@SuppressWarnings("FutureReturnValueIgnored")
public StanzaListener addStanzaIdAcknowledgedListener(final String id, StanzaListener listener) throws StreamManagementNotEnabledException { public StanzaListener addStanzaIdAcknowledgedListener(final String id, StanzaListener listener) throws StreamManagementNotEnabledException {
// Prevent users from adding callbacks that will never get removed // Prevent users from adding callbacks that will never get removed
if (!smWasEnabledAtLeastOnce) { if (!smWasEnabledAtLeastOnce) {

View File

@ -103,7 +103,7 @@ public class PacketWriterTest {
} }
} }
public class BlockingStringWriter extends Writer { public static class BlockingStringWriter extends Writer {
@Override @Override
@SuppressWarnings("WaitNotInLoop") @SuppressWarnings("WaitNotInLoop")
public void write(char[] cbuf, int off, int len) throws IOException { public void write(char[] cbuf, int off, int len) throws IOException {