-
Bug
-
Resolution: Fixed
-
P3
-
8, 9, 10
-
b36
-
Verified
For the region specific data, we would get the data from CLDR only regards to the region settings in locale. In current implementation, if we use an "invalid" locale, e.g. "zh-ES", as this locale hasn't been handled correctly when need to search the region specific information, so we would get the data from root resource bundle.
===== Code
public static void main(String[] args) {
Locale normLocale = Locale.forLanguageTag("es-ES");
Locale oddLocale = Locale.forLanguageTag("zh-ES");
print(normLocale);
print(oddLocale);
}
private static void print(Locale loc) {
Calendar ca = Calendar.getInstance(loc);
int minDayInFirstWeek = ca.getMinimalDaysInFirstWeek();
int firstDayOfWeek = ca.getFirstDayOfWeek();
System.out.println("minDay: "+minDayInFirstWeek +" firstDay: "+firstDayOfWeek);
}
===== Output
minDay: 4 firstDay: 2
minDay: 1 firstDay: 1
===== Expected:
minDay: 4 firstDay: 2
minDay: 4 firstDay: 2
===== Code
public static void main(String[] args) {
Locale normLocale = Locale.forLanguageTag("es-ES");
Locale oddLocale = Locale.forLanguageTag("zh-ES");
print(normLocale);
print(oddLocale);
}
private static void print(Locale loc) {
Calendar ca = Calendar.getInstance(loc);
int minDayInFirstWeek = ca.getMinimalDaysInFirstWeek();
int firstDayOfWeek = ca.getFirstDayOfWeek();
System.out.println("minDay: "+minDayInFirstWeek +" firstDay: "+firstDayOfWeek);
}
===== Output
minDay: 4 firstDay: 2
minDay: 1 firstDay: 1
===== Expected:
minDay: 4 firstDay: 2
minDay: 4 firstDay: 2
- relates to
-
JDK-8272117 weekOfYear off by one week for Locale.GERMAN
- Closed
-
JDK-8177568 JEP 314: Additional Unicode Language-Tag Extensions
- Closed