-
Bug
-
Resolution: Fixed
-
P2
-
11
-
b19
-
b12
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8212746 | 11.0.2 | Aleksej Efimov | P2 | Closed | Fixed | b02 |
ADDITIONAL SYSTEM INFORMATION :
(Discovered in Apache Lucene/Solr randomized tests including locale & JVM randomization)
A DESCRIPTION OF THE PROBLEM :
When the default locale is Arabic, the timeZone.getDisplayName method does not honor the Locale.US argument. This is important as it's used by date.toString()!
REGRESSION : Last worked in version 8u181
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
(see short demonstration program)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
GMT+05:00
ACTUAL -
GMT+ÃÂ ÃÂ¥:ÃÂ ÃÂ
---------- BEGIN SOURCE ----------
// RUN WITH ASSERTIONS ENABLED: -ea
import java.util.Locale;
import java.util.TimeZone;
public class TestJdkBug {
public static void main(String[] args) {
Locale.setDefault(Locale.forLanguageTag("ar")); // (Arabic)
TimeZone zi = TimeZone.getTimeZone("Etc/GMT-5");
final String displayName = zi.getDisplayName(false, TimeZone.SHORT, Locale.US);
assert "GMT+05:00".equals(displayName) : displayName;
}
}
---------- END SOURCE ----------
FREQUENCY : always
(Discovered in Apache Lucene/Solr randomized tests including locale & JVM randomization)
A DESCRIPTION OF THE PROBLEM :
When the default locale is Arabic, the timeZone.getDisplayName method does not honor the Locale.US argument. This is important as it's used by date.toString()!
REGRESSION : Last worked in version 8u181
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
(see short demonstration program)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
GMT+05:00
ACTUAL -
GMT+ÃÂ ÃÂ¥:ÃÂ ÃÂ
---------- BEGIN SOURCE ----------
// RUN WITH ASSERTIONS ENABLED: -ea
import java.util.Locale;
import java.util.TimeZone;
public class TestJdkBug {
public static void main(String[] args) {
Locale.setDefault(Locale.forLanguageTag("ar")); // (Arabic)
TimeZone zi = TimeZone.getTimeZone("Etc/GMT-5");
final String displayName = zi.getDisplayName(false, TimeZone.SHORT, Locale.US);
assert "GMT+05:00".equals(displayName) : displayName;
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8212746 TimeZone.getDisplayName given Locale.US doesn't always honor the Locale
- Closed
- relates to
-
JDK-8202537 Update CLDR to version V33
- Resolved