-
Bug
-
Resolution: Fixed
-
P3
-
1.1.4
-
1.2beta3
-
sparc
-
solaris_2.5.1
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2018430 | 1.1.6 | Masayoshi Okutsu | P3 | Closed | Fixed | 1.1.6 |
Name: mf23781 Date: 12/18/97
The set() method of the Calendar class does not set the "day of
the year" correctly. Example follows:
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.text.FieldPosition;
public class CalTestCase
{
public static void main(String args[])
{
GregorianCalendar cal = (GregorianCalendar)Calendar.getInstance();
cal.set(Calendar.YEAR, 1997);
cal.set(Calendar.DAY_OF_YEAR, 1);
Date d = cal.getTime(); // Should be Jan 1
System.out.println(d);
}
}
Instead of setting the date to January 1st, the date is set to
today's date!
This works on 1.1.2, but appears to be broken on all 1.1.4 ports.
======================================================================
- backported by
-
JDK-2018430 Calendar.set() does not set the date correctly
- Closed