Fix bug Bug 380005: Date to String conversion code in NativeDate class is not

thread-safe.


git-svn-id: svn://10.0.0.236/trunk@227987 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nboyd%atg.com 2007-06-13 17:51:16 +00:00
parent a7213c2981
commit 9efe341932

View File

@ -1052,7 +1052,9 @@ final class NativeDate extends IdScriptableObject
}
result.append(" (");
java.util.Date date = new Date((long) t);
result.append(timeZoneFormatter.format(date));
synchronized (timeZoneFormatter) {
result.append(timeZoneFormatter.format(date));
}
result.append(')');
}
return result.toString();
@ -1126,7 +1128,9 @@ final class NativeDate extends IdScriptableObject
default: formatter = null; // unreachable
}
return formatter.format(new Date((long) t));
synchronized (formatter) {
return formatter.format(new Date((long) t));
}
}
private static String js_toUTCString(double date)