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