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

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

@ -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) {
}

View file

@ -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);
}

View file

@ -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>");

View file

@ -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")) {