classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] small fix to GregorianCalendar


From: Noa Resare
Subject: [cp-patches] small fix to GregorianCalendar
Date: Thu, 18 Nov 2004 21:16:53 +0100

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.

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?

/noa

-- 
nuclear cia fbi spy password code president bomb
F3C4 AC90 B885 FE15 344B  4D05 220B 7662 A190 6F09

Attachment: classpath-gregorian-calendar.patch
Description: Text Data

Attachment: signature.asc
Description: Detta är en digitalt signerad meddelandedel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]