Bug 179074 - GregorianCalendar setFirstDayOfWeek is broken
Summary: GregorianCalendar setFirstDayOfWeek is broken
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.4.2-gcj-compat
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bryce McKinlay
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-01-27 00:40 UTC by Chris Seawood
Modified: 2008-04-02 22:26 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-04-02 22:26:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Testcase java source (617 bytes, text/plain)
2006-01-27 00:40 UTC, Chris Seawood
no flags Details

Description Chris Seawood 2006-01-27 00:40:32 UTC
We have some code that determines the first & last day of the week (Sunday &
Saturday, respectively) and sets a couple of Date variables appropriately.  When
using the jdk bundled with FC4+updates, we noticed that it's returning Sunday of
the next week instead of the previous Sunday.  It appears as though the JVM is
using Monday as the first day of the week. Using
|cal.setFirstDayOfWeek(GregorianCalendar.SUNDAY)| has no effect unless the value
is explicitly set to 0 which isn't a valid value afaict.  The JDK from sun.com
works correctly.

Here's the output from the testcase.  The first run is using FC4's java/javac
and the second is using Sun's java/javac.  The source code is attached.

[cseawood@blitzwing foo]$ javac TC.java && java TC
Today is : Thu Jan 26 16:40:19 PST 2006
First day of week: 1 and SUNDAY = 1
Previous Sunday is: Sun Jan 29 16:40:19 PST 2006
[cseawood@blitzwing foo]$ /opt/java/java/bin/javac TC.java &&
/opt/java/java/bin/java TC
Today is : Thu Jan 26 16:40:27 PST 2006
First day of week: 1 and SUNDAY = 1
Previous Sunday is: Sun Jan 22 16:40:27 PST 2006
[cseawood@blitzwing foo]$

Comment 1 Chris Seawood 2006-01-27 00:40:33 UTC
Created attachment 123758 [details]
Testcase java source

Comment 2 Thomas Fitzsimmons 2006-02-04 07:25:54 UTC
Reassigning to Bryce Mckinlay who has experience dealing with GregorianCalendar
issues.


Comment 3 Christian Iseli 2007-01-22 11:54:38 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 4 Chris Seawood 2007-01-22 18:13:19 UTC
[cseawood@blitzwing Incoming]$ rpm -q fedora-release
fedora-release-6-4
[cseawood@blitzwing Incoming]$ javac TC.java && java TC
Today is : Mon Jan 22 10:08:06 PST 2007
First day of week: 1 and SUNDAY = 1
Previous Sunday is: Sun Jan 28 10:08:06 PST 2007
[cseawood@blitzwing Incoming]$ /usr/java/j2sdk1.4.2_11/bin/javac TC.java &&
/usr/java/j2sdk1.4.2_11/bin/java TC
Today is : Mon Jan 22 10:09:10 PST 2007
First day of week: 1 and SUNDAY = 1
Previous Sunday is: Sun Jan 21 10:09:10 PST 2007
[cseawood@blitzwing Incoming]$

Comment 5 Thomas Fitzsimmons 2008-04-02 22:26:21 UTC
Use OpenJDK instead.  It's available in Rawhide.


Note You need to log in before you can comment on or make changes to this bug.