[Mono-bugs] [Bug 76252][Min] Changed - Exception in HebrewCalendar Class func GetDaysInMonth()

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Mar 20 02:04:53 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by atsushi at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76252

--- shadow/76252	2006-03-10 03:42:54.000000000 -0500
+++ shadow/76252.tmp.8648	2006-03-20 02:04:53.000000000 -0500
@@ -78,6 +78,44 @@
 I test another Calendar classes and run ok.
 
 Using a mono 1.1.9.1 (sep 2005).
 
 ------- Additional Comments From atsushi at ximian.com  2006-03-10 03:42 -------
 Will have a look at this problem.
+
+------- Additional Comments From atsushi at ximian.com  2006-03-20 02:04 -------
+Shorthand repro code.
+
+using System;
+using System.Globalization;
+
+public class Test
+{
+        public static void Main ()
+        {
+                HebrewCalendar c = new HebrewCalendar ();
+                int days = c.GetDaysInMonth (5765, 13, 1);
+                if (days != 29)
+                        throw new Exception ();
+        }
+}
+
+
+The source of the problem I think is in CCHebrewCalendar class in
+mcs/class/System.Globalization/CalendralCalculations.cs.
+CCHebrewCalendar.fixed_from_dmy() expects that for Hebrew month
+under 7 it needs to add days of from 8th month to 12th or 13th month.
+I think it could be either 7 or 8.
+
+However, if I rewrite this method as to do that, it causes infinite
+loop since last_day_of_month() internally calls long_heshvan() and
+short_kislev(). They both internally call days_in_year() which calls
+fixed_from_dmy() - and thus it causes infinite loop.
+
+As long as I wikipedia it, the formula to compute days in Kislev
+and Cheshvan (Heshvan) is pretty complex. It should not be like
+current code which determines the number of days in chicken-and-egg
+computation.
+http://en.wikipedia.org/wiki/Hebrew_calendar
+
+I'll post to devel-list to ask for some help since Hebrew rule is far
+beyond my understanding :(


More information about the mono-bugs mailing list