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:
parent
a7213c2981
commit
9efe341932
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user