Prevent race condition when switching timezones.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5605 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hermens 16 years ago
parent 40ab13c886
commit 2173865f92

@ -397,10 +397,10 @@ public final class DateFormatter {
/** called by all public format...(..., TimeZone) methods */
private static String format(final SimpleDateFormat format, final Date date, final TimeZone tz) {
final TimeZone bakTZ = format.getTimeZone();
String result;
synchronized (format) {
final TimeZone bakTZ = format.getTimeZone();
format.setTimeZone(tz == null ? TZ_GMT : tz);
result = format.format(date);
format.setTimeZone(bakTZ);

Loading…
Cancel
Save