[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] small fix to GregorianCalendar
From: |
Noa Resare |
Subject: |
Re: [cp-patches] small fix to GregorianCalendar |
Date: |
Thu, 18 Nov 2004 22:25:25 +0100 |
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.
> > 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 :)
/noa
--
nuclear cia fbi spy password code president bomb
F3C4 AC90 B885 FE15 344B 4D05 220B 7662 A190 6F09
signature.asc
Description: Detta är en digitalt signerad meddelandedel