mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 12:37:58 +01:00
Update Error Prone to 2.0.18
and update errorprone-plugin to 0.0.9.
This commit is contained in:
parent
52a52e12d2
commit
c81f28a3a2
11 changed files with 61 additions and 18 deletions
|
@ -10,7 +10,7 @@ buildscript {
|
|||
classpath 'org.kordamp:markdown-gradle-plugin:1.0.0'
|
||||
classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.0'
|
||||
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'
|
||||
|
@ -170,7 +170,7 @@ allprojects {
|
|||
// version 52.0" error messages caused by the errorprone javac.
|
||||
// See https://github.com/tbroyer/gradle-errorprone-plugin/issues/18 for more information.
|
||||
configurations.errorprone {
|
||||
resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.15'
|
||||
resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.18'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1481,6 +1481,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
getReplyTimeout());
|
||||
}
|
||||
|
||||
@SuppressWarnings("FutureReturnValueIgnored")
|
||||
@Override
|
||||
public void sendStanzaWithResponseCallback(Stanza stanza, final StanzaFilter replyFilter,
|
||||
final StanzaListener callback, final ExceptionCallback exceptionCallback,
|
||||
|
@ -1553,6 +1554,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
sendStanzaWithResponseCallback(iqRequest, replyFilter, callback, exceptionCallback, timeout);
|
||||
}
|
||||
|
||||
@SuppressWarnings("FutureReturnValueIgnored")
|
||||
@Override
|
||||
public void addOneTimeSyncCallback(final StanzaListener callback, final StanzaFilter packetFilter) {
|
||||
final StanzaListener packetListener = new StanzaListener() {
|
||||
|
|
|
@ -594,7 +594,7 @@ abstract public class Node
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class ItemEventTranslator implements StanzaListener
|
||||
public static class ItemEventTranslator implements StanzaListener
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
private ItemEventListener listener;
|
||||
|
@ -623,7 +623,7 @@ abstract public class Node
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class ItemDeleteTranslator implements StanzaListener
|
||||
public static class ItemDeleteTranslator implements StanzaListener
|
||||
{
|
||||
private ItemDeleteListener listener;
|
||||
|
||||
|
|
|
@ -387,7 +387,7 @@ public class ChatConnectionTest {
|
|||
}
|
||||
}
|
||||
|
||||
private class TestMessageListener implements ChatMessageListener {
|
||||
private static class TestMessageListener implements ChatMessageListener {
|
||||
private Chat msgChat;
|
||||
private int counter = 0;
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("LiteralClassName")
|
||||
private void detectCaptureDevices() {
|
||||
// check if JavaSound capture is available
|
||||
message("Looking for Audio capturer");
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
*/
|
||||
public class AgentStatus implements ExtensionElement {
|
||||
|
||||
@SuppressWarnings("SimpleDateFormatConstant")
|
||||
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
|
||||
|
||||
static {
|
||||
|
@ -206,7 +207,11 @@ public class AgentStatus implements ExtensionElement {
|
|||
buf.append(" userID=\"").append(userID).append('"');
|
||||
}
|
||||
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) {
|
||||
buf.append(" email=\"").append(email).append('"');
|
||||
|
@ -260,7 +265,9 @@ public class AgentStatus implements ExtensionElement {
|
|||
String userID = parser.getAttributeValue("", "userID");
|
||||
Date date = null;
|
||||
try {
|
||||
date = UTC_FORMAT.parse(parser.getAttributeValue("", "startTime"));
|
||||
synchronized (UTC_FORMAT) {
|
||||
date = UTC_FORMAT.parse(parser.getAttributeValue("", "startTime"));
|
||||
}
|
||||
}
|
||||
catch (ParseException e) {
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
*/
|
||||
public class OccupantsInfo extends IQ {
|
||||
|
||||
@SuppressWarnings("SimpleDateFormatConstant")
|
||||
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
|
||||
|
||||
static {
|
||||
|
@ -93,7 +94,9 @@ public class OccupantsInfo extends IQ {
|
|||
buf.append("</name>");
|
||||
// Add the date when the occupant joined the room
|
||||
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("</occupant>");
|
||||
}
|
||||
|
@ -165,7 +168,9 @@ public class OccupantsInfo extends IQ {
|
|||
} else if ((eventType == XmlPullParser.START_TAG) &&
|
||||
("joined".equals(parser.getName()))) {
|
||||
try {
|
||||
joined = UTC_FORMAT.parse(parser.nextText());
|
||||
synchronized (UTC_FORMAT) {
|
||||
joined = UTC_FORMAT.parse(parser.nextText());
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
throw new SmackException(e);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.jxmpp.jid.Jid;
|
|||
*/
|
||||
public class Transcripts extends IQ {
|
||||
|
||||
@SuppressWarnings("SimpleDateFormatConstant")
|
||||
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
|
||||
static {
|
||||
UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+0"));
|
||||
|
@ -169,10 +170,18 @@ public class Transcripts extends IQ {
|
|||
.append("\">");
|
||||
|
||||
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) {
|
||||
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>");
|
||||
for (AgentDetail agentDetail : agentDetails) {
|
||||
|
@ -234,10 +243,18 @@ public class Transcripts extends IQ {
|
|||
buf.append("<agentJID>").append(agentJID).append("</agentJID>");
|
||||
}
|
||||
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) {
|
||||
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>");
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ import java.util.TimeZone;
|
|||
*/
|
||||
public class TranscriptsProvider extends IQProvider<Transcripts> {
|
||||
|
||||
@SuppressWarnings("SimpleDateFormatConstant")
|
||||
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
|
||||
static {
|
||||
UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+0"));
|
||||
|
@ -79,12 +80,16 @@ public class TranscriptsProvider extends IQProvider<Transcripts> {
|
|||
if (eventType == XmlPullParser.START_TAG) {
|
||||
if (parser.getName().equals("joinTime")) {
|
||||
try {
|
||||
joinTime = UTC_FORMAT.parse(parser.nextText());
|
||||
synchronized (UTC_FORMAT) {
|
||||
joinTime = UTC_FORMAT.parse(parser.nextText());
|
||||
}
|
||||
} catch (ParseException e) {}
|
||||
}
|
||||
else if (parser.getName().equals("leftTime")) {
|
||||
try {
|
||||
leftTime = UTC_FORMAT.parse(parser.nextText());
|
||||
synchronized (UTC_FORMAT) {
|
||||
leftTime = UTC_FORMAT.parse(parser.nextText());
|
||||
}
|
||||
} catch (ParseException e) {}
|
||||
}
|
||||
else if (parser.getName().equals("agents")) {
|
||||
|
@ -116,12 +121,16 @@ public class TranscriptsProvider extends IQProvider<Transcripts> {
|
|||
}
|
||||
else if (parser.getName().equals("joinTime")) {
|
||||
try {
|
||||
joinTime = UTC_FORMAT.parse(parser.nextText());
|
||||
synchronized (UTC_FORMAT) {
|
||||
joinTime = UTC_FORMAT.parse(parser.nextText());
|
||||
}
|
||||
} catch (ParseException e) {}
|
||||
}
|
||||
else if (parser.getName().equals("leftTime")) {
|
||||
try {
|
||||
leftTime = UTC_FORMAT.parse(parser.nextText());
|
||||
synchronized (UTC_FORMAT) {
|
||||
leftTime = UTC_FORMAT.parse(parser.nextText());
|
||||
}
|
||||
} catch (ParseException e) {}
|
||||
}
|
||||
else if (parser.getName().equals("agent")) {
|
||||
|
|
|
@ -681,6 +681,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
* @throws SmackException
|
||||
* @throws Exception if an exception occurs.
|
||||
*/
|
||||
@SuppressWarnings("LiteralClassName")
|
||||
private void proceedTLSReceived() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, NoSuchProviderException, UnrecoverableKeyException, KeyManagementException, SmackException {
|
||||
SSLContext context = this.config.getCustomSSLContext();
|
||||
KeyStore ks = null;
|
||||
|
@ -1710,6 +1711,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
* @return the previous listener for this stanza ID or null.
|
||||
* @throws StreamManagementNotEnabledException if Stream Management is not enabled.
|
||||
*/
|
||||
@SuppressWarnings("FutureReturnValueIgnored")
|
||||
public StanzaListener addStanzaIdAcknowledgedListener(final String id, StanzaListener listener) throws StreamManagementNotEnabledException {
|
||||
// Prevent users from adding callbacks that will never get removed
|
||||
if (!smWasEnabledAtLeastOnce) {
|
||||
|
|
|
@ -103,7 +103,7 @@ public class PacketWriterTest {
|
|||
}
|
||||
}
|
||||
|
||||
public class BlockingStringWriter extends Writer {
|
||||
public static class BlockingStringWriter extends Writer {
|
||||
@Override
|
||||
@SuppressWarnings("WaitNotInLoop")
|
||||
public void write(char[] cbuf, int off, int len) throws IOException {
|
||||
|
|
Loading…
Reference in a new issue