ICU-11139 A quick fix in the new DateFormat factory logic to use the current default time zone in a new instance.

X-SVN-Rev: 36759
This commit is contained in:
Yoshito Umaoka 2014-11-20 00:41:24 +00:00
parent 738cee69cc
commit 82bd8a35f4

View file

@ -208,6 +208,13 @@ static DateFormat *createFromCache(
ptr->removeRef();
if (result == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
} else {
// Set the currently active default TimeZone,
// because the cached instance might be created
// with another TimeZone.
// Note: We could do some optimization in SharedDateFormat
// to pick up the current default without cloning old default.
result->adoptTimeZone(TimeZone::createDefault());
}
return result;
}