From 77e1ba0c544701f3291f010808dd6e9c3e248054 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 12 Sep 2012 09:13:51 +0200 Subject: [PATCH] Synchronize access on DateFormat. --- .../java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java index 84badf2..f6bc05d 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java @@ -66,7 +66,9 @@ public class GetTimesAjaxPage extends JsonPage { Time time = getTime(post.getTime()); postTime.put("timeText", time.getText()); postTime.put("refreshTime", time.getRefresh() / Time.SECOND); - postTime.put("tooltip", dateFormat.format(new Date(post.getTime()))); + synchronized (dateFormat) { + postTime.put("tooltip", dateFormat.format(new Date(post.getTime()))); + } postTimes.put(id, postTime); } } @@ -83,7 +85,9 @@ public class GetTimesAjaxPage extends JsonPage { Time time = getTime(reply.getTime()); replyTime.put("timeText", time.getText()); replyTime.put("refreshTime", time.getRefresh() / Time.SECOND); - replyTime.put("tooltip", dateFormat.format(new Date(reply.getTime()))); + synchronized (dateFormat) { + replyTime.put("tooltip", dateFormat.format(new Date(reply.getTime()))); + } replyTimes.put(id, replyTime); } } -- 2.7.4