-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
8u60, 9
-
x86
-
windows_8
FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]
A DESCRIPTION OF THE PROBLEM :
when calling getFirstDayOfWeek() for a calendar object with the locale set to en_NZ or en_AU this returns 1 (SUNDAY) when it should return 2 (MONDAY)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the following code:
import java.util.Locale;
import java.util.Calendar;
public class cal {
public static void main(String[] args) {
Locale locale = new Locale("en", "AU");
System.out.println("Locale: '" + locale + "'");
System.out.println("SUNDAY: " + String.valueOf(Calendar.SUNDAY));
System.out.println("MONDAY: " + String.valueOf(Calendar.MONDAY));
Calendar calend = Calendar.getInstance(locale);
System.out.println("Default first week day: " + String.valueOf(calend.getFirstDayOfWeek()));
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Locale: 'en_AU'
SUNDAY: 1
MONDAY: 2
Default first week day: 1
ACTUAL -
Locale: 'en_AU'
SUNDAY: 1
MONDAY: 2
Default first week day: 2
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class cal {
public static void main(String[] args) {
Locale locale = new Locale("en", "AU");
Calendar calend = Calendar.getInstance(locale);
System.out.println(String.valueOf(calend.getFirstDayOfWeek()));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Could use setFirstDayOfWeek() method to manually set the first day of the week.
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]
A DESCRIPTION OF THE PROBLEM :
when calling getFirstDayOfWeek() for a calendar object with the locale set to en_NZ or en_AU this returns 1 (SUNDAY) when it should return 2 (MONDAY)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the following code:
import java.util.Locale;
import java.util.Calendar;
public class cal {
public static void main(String[] args) {
Locale locale = new Locale("en", "AU");
System.out.println("Locale: '" + locale + "'");
System.out.println("SUNDAY: " + String.valueOf(Calendar.SUNDAY));
System.out.println("MONDAY: " + String.valueOf(Calendar.MONDAY));
Calendar calend = Calendar.getInstance(locale);
System.out.println("Default first week day: " + String.valueOf(calend.getFirstDayOfWeek()));
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Locale: 'en_AU'
SUNDAY: 1
MONDAY: 2
Default first week day: 1
ACTUAL -
Locale: 'en_AU'
SUNDAY: 1
MONDAY: 2
Default first week day: 2
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class cal {
public static void main(String[] args) {
Locale locale = new Locale("en", "AU");
Calendar calend = Calendar.getInstance(locale);
System.out.println(String.valueOf(calend.getFirstDayOfWeek()));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Could use setFirstDayOfWeek() method to manually set the first day of the week.
- relates to
-
JDK-8151583 In Bulgaria (and many EU countries) the first day of week is Monday but not Sunday
- Closed