Bug 22846 - java.util.Calendar fails to set month and day of week
Summary: java.util.Calendar fails to set month and day of week
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-22 00:54 UTC by from-classpath
Modified: 2005-07-23 22:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description from-classpath 2005-01-22 00:54:41 UTC
The Calendar class appears to ignore calls to set which change the day of the week and/or the month to be used.  The remaining eight failing java.text.SimpleDateFormat parse test cases (0 to 4 and 17 to 20) illustrate this.

The first tries to set Dec 1978, but the calendar only changes the year to 1978.  The same is true of the next two, where the calendar ignores the August month setting.

The fourth is a more strange case, where the day of the week, the month and the year are set (in that order).  This should use a pattern containing all these values, with a default week of the month of 1.  The expected result is the first Saturday in November, 2004.  But, as in all the above, only the year is actually set.

The last four all test with the same values (it is the parsing process that differs).  They try to set the first Saturday in June.  They fail as above.  Solving just this would fix four test cases.

A stripped-down version is provided below.

Comment 1 from-classpath 2005-02-02 21:45:19 UTC
I believe this is fixed now.