[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] small fix to GregorianCalendar
From: |
Michael Koch |
Subject: |
Re: [cp-patches] small fix to GregorianCalendar |
Date: |
Thu, 18 Nov 2004 23:34:30 +0100 |
User-agent: |
KMail/1.6.2 |
Am Donnerstag, 18. November 2004 22:25 schrieb Noa Resare:
> tor 2004-11-18 klockan 22:25 +0100 skrev Michael Koch:
> > Am Donnerstag, 18. November 2004 21:16 schrieb Noa Resare:
> > > In current classpath, if you fetch a Calendar object with
> > > getInstance() and clear() it and set just the MONTH and YEAR
> > > field you get a calendar that is set to the first day of the
> > > given year with the month value simply dropped.
> > >
> > > This is because the getDayOfYear() method in GregorianCalendar
> > > doesn't handle the case where year and month is set and not
> > > day. According to the documentation the default value for
> > > DAY_OF_MONTH should be used (which happens to be 1) but our
> > > implementation just returns the first day of the year.
> >
> > Are there mauve testcases that check for this so we can be sure
> > this is fixed after patching classpath ?
>
> As I state below, yes. I added a test for this in
> mauve/gnu/testlet/java/util/Calendar/set.java (the last one
> executed) that passes with sun's 1.4.2_06 and fails with current
> cvs but passes with my patch applied.
Oh, I overread this, sorry.
> > > Attached is a patch that fixes that, making behavior consistent
> > > with j2sdk1.4.2_06 and removing one mauve test failure in
> > > java.util.Calendar.set
> > >
> > > Ok to apply?
> >
> > Bryce McKinley should look into this.
>
> I do hope he does :)
He is currently at a conference but on monday he will surely do.
Michael
--
Homepage: http://www.worldforge.org/