On 01.04.2008 08:02, Vadim Gritsenko wrote:

fix threading issue (DateFormat is not thread-safe)

    public String getLastAccessTime() {
-        return formatter.format(new Date(wc.getLastAccessTime()));
+        synchronized (this.formatter) {
+            return formatter.format(new Date(wc.getLastAccessTime()));
+        }
    }

The better fix is to use FastDateFormat which features thread safe formatting.

All these nice little gems hidden in Apache Commons libs :)

Applied.

Thanks,

Joerg

Reply via email to