JDK-7060794 : Regression: Calendar.getFirstDayOfWeek() returns wrong value in Ukraine locale
  • Type: Bug
  • Component: globalization
  • Sub-Component: locale-data
  • Affected Version: 6u26
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2011-06-29
  • Updated: 2012-12-20
  • Resolved: 2011-06-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u26Resolved
Related Reports
Relates :  
Description
SYNOPSIS
--------
Regression: Calendar.getFirstDayOfWeek() returns wrong value in Ukraine locale

OPERATING SYSTEM
----------------
All

FULL JDK VERSION
----------------
Reproducible with Java 6 and JDK 7
Not reproducible with 5.0/1.4.2

REPRODUCTION INSTRUCTIONS
-------------------------
Compile and run the attached testcase

Observed result
   Output is "1"

Expected result
   Output should be "2"
   (in the Ukraine Monday is the first day of the week)

This same problem was apparently fixed in 1.4.1 under CR 4527203, but the problem seems to have been reintroduced in Java 6.

TESTCASE
--------
import java.util.*;

public class MinDays {
    public static void main(String[] args) {
        Calendar cal = Calendar.getInstance(new Locale("ua", "UA"));
        System.out.println(cal.getFirstDayOfWeek());
    }
}

Comments
EVALUATION In ISO 639, the language code of Ukrainian is uk, not ua. UA is the country code of UKRAINE in ISO 3166. If the testing program is changed to the source code below, the output for the first day of week will be 2. I also checked 1.4.1, 1.4.2 and 5. When the the language code is ua, it also can not get the expected value, 2. //source code import java.util.*; public class MinDays { public static void main(String[] args) { Calendar cal = Calendar.getInstance(new Locale("uk", "UA")); System.out.println(cal.getFirstDayOfWeek()); } }
30-06-2011