[kaffe] CVS kaffe (kaz): java/util/GregorianCalendar.java:

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Thu Sep 11 15:37:01 2003


PatchSet 4027 
Date: 2003/09/11 22:34:45
Author: kaz
Branch: HEAD
Tag: (none) 
Log:
2003-09-11  Ito Kazumitsu <kaz@maczuka.gcd.org>
        * java/util/GregorianCalendar.java:
        (getLinearTime) corrected a bug of counting leap days twice.

Members: 
	ChangeLog:1.1623->1.1624 
	libraries/javalib/java/util/GregorianCalendar.java:1.19->1.20 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1623 kaffe/ChangeLog:1.1624
--- kaffe/ChangeLog:1.1623	Thu Sep 11 22:09:36 2003
+++ kaffe/ChangeLog	Thu Sep 11 22:34:45 2003
@@ -1,3 +1,7 @@
+2003-09-11  Ito Kazumitsu <kaz@maczuka.gcd.org>
+	* java/util/GregorianCalendar.java:
+	(getLinearTime) corrected a bug of counting leap days twice.
+
 2003-09-11  Dalibor Topic <robilad@kaffe.org>
 
 	* kaffe/kaffevm/external.c:
Index: kaffe/libraries/javalib/java/util/GregorianCalendar.java
diff -u kaffe/libraries/javalib/java/util/GregorianCalendar.java:1.19 kaffe/libraries/javalib/java/util/GregorianCalendar.java:1.20
--- kaffe/libraries/javalib/java/util/GregorianCalendar.java:1.19	Sat Aug 16 11:03:48 2003
+++ kaffe/libraries/javalib/java/util/GregorianCalendar.java	Thu Sep 11 22:34:47 2003
@@ -254,8 +254,11 @@
 	//
 	// The additional leap year factor accounts for the fact that
 	// a leap day is not seen on Jan 1 of the leap year.
+	// And on and after the leap day, the leap day has already been
+	// included in dayOfYear.
+
 	int gregOffset = (year / 400) - (year / 100) + 2;
-	if (isLeapYear (year, true) && dayOfYear < 31 + 29)
+	if (isLeapYear (year, true))
 	  --gregOffset;
 	time += gregOffset * (24 * 60 * 60 * 1000L);
       }