2007-01-25 Chris Toshok <toshok@ximian.com>
authorChris Toshok <toshok@novell.com>
Thu, 25 Jan 2007 19:44:15 +0000 (19:44 -0000)
committerChris Toshok <toshok@novell.com>
Thu, 25 Jan 2007 19:44:15 +0000 (19:44 -0000)
* Calendar.cs, HijriCalendar.cs, ThaiBuddhistCalendar.cs,
HebrewCalendar.cs, GregorianCalendar.cs, KoreanCalendar.cs,
JulianCalendar.cs, PersianCalendar.cs:

more serialization fixes.  the M_TwoDigitYearMax field we use
appears to be called twoDigitYearMax in MS.NET.  rename it (and
fix all the Calendar subclasses to use this naming).  Likewise
with is_readonly (MS calls it m_isReadOnly).

Also, the m_currentEraValue field I had originally placed in
GregorianCalendar appears to be in Calendar (as running
nunit-2.2.8-2.0 shows.)

In GregorianCalendar, rename the M_CalendarType field to m_type
and remove the extra field I added.

The previous fix got nunit 2.4-2.0 running.  This change gets
versions 2.2.8 and 2.4 of nunit running against both 1.1 and 2.0
profiles.

svn path=/trunk/mcs/; revision=71706

mcs/class/corlib/System.Globalization/Calendar.cs
mcs/class/corlib/System.Globalization/ChangeLog
mcs/class/corlib/System.Globalization/GregorianCalendar.cs
mcs/class/corlib/System.Globalization/HebrewCalendar.cs
mcs/class/corlib/System.Globalization/HijriCalendar.cs
mcs/class/corlib/System.Globalization/JulianCalendar.cs
mcs/class/corlib/System.Globalization/KoreanCalendar.cs
mcs/class/corlib/System.Globalization/PersianCalendar.cs
mcs/class/corlib/System.Globalization/ThaiBuddhistCalendar.cs

index c4d27e01f53c5683a24c29a4017f23a858cde635..e07b05f4bf88ca12ff23031717f958b23d7ba08e 100644 (file)
@@ -127,7 +127,7 @@ public abstract class Calendar
        public abstract int[] Eras { get; }
 
        [NonSerialized]
-       bool is_readonly;
+       bool m_isReadOnly;
 
 #if NET_2_0
        [System.Runtime.InteropServices.ComVisible(false)]
@@ -155,22 +155,22 @@ public abstract class Calendar
        public virtual object Clone ()
        {
                Calendar c = (Calendar) MemberwiseClone ();
-               c.is_readonly = false;
+               c.m_isReadOnly = false;
                return c;
        }
 #endif
 
 #if NET_2_0
        public bool IsReadOnly {
-               get { return is_readonly; }
+               get { return m_isReadOnly; }
        }
 
        public static Calendar ReadOnly (Calendar source)
        {
-               if (source.is_readonly)
+               if (source.m_isReadOnly)
                        return source;
                Calendar c = (Calendar) source.Clone ();
-               c.is_readonly = true;
+               c.m_isReadOnly = true;
                return c;
        }
 #else
@@ -186,7 +186,7 @@ public abstract class Calendar
 
        internal void CheckReadOnly ()
        {
-               if (is_readonly)
+               if (m_isReadOnly)
                        throw new InvalidOperationException ("This Calendar is read-only.");
        }
 
@@ -196,7 +196,7 @@ public abstract class Calendar
        /// property.
        /// </summary>
        [NonSerialized]
-       internal int M_TwoDigitYearMax;
+       internal int twoDigitYearMax;
        
 
        /// <summary>
@@ -237,13 +237,13 @@ public abstract class Calendar
        /// <para>It might be overridden.</para>
        /// </value>
        public virtual int TwoDigitYearMax {
-               get { return M_TwoDigitYearMax; }
+               get { return twoDigitYearMax; }
                set {
                        CheckReadOnly ();
                        M_ArgumentInRange("year", value, 100, M_MaxYear);
                        int era = CurrentEra;
                        M_CheckYE(value, ref era);
-                       M_TwoDigitYearMax = value;
+                       twoDigitYearMax = value;
                }
        }
 
@@ -947,7 +947,7 @@ public abstract class Calendar
        /// in the ctors of the derived classes, if it is 99.
        /// </remarks>
        protected Calendar() {
-               M_TwoDigitYearMax = 99;
+               twoDigitYearMax = 99;
        }
 
        /// <summary>Protected field storing the abbreviated era names.
@@ -1010,6 +1010,11 @@ public abstract class Calendar
                        M_EraNames = (string[])value.Clone();
                }
        }
+
+#if NET_2_0
+       internal int m_currentEraValue; // Unused, by MS serializes this
+#endif
+
 } // class Calendar
        
 } // namespace System.Globalization
index 35c57854a4d5345d90f8226bc3165f8ce25df459..5059e87a0d65ddeb42cfdad1035bc02d08814c8c 100644 (file)
@@ -1,3 +1,25 @@
+2007-01-25  Chris Toshok  <toshok@ximian.com>
+
+       * Calendar.cs, HijriCalendar.cs, ThaiBuddhistCalendar.cs,
+       HebrewCalendar.cs, GregorianCalendar.cs, KoreanCalendar.cs,
+       JulianCalendar.cs, PersianCalendar.cs:
+
+       more serialization fixes.  the M_TwoDigitYearMax field we use
+       appears to be called twoDigitYearMax in MS.NET.  rename it (and
+       fix all the Calendar subclasses to use this naming).  Likewise
+       with is_readonly (MS calls it m_isReadOnly).
+
+       Also, the m_currentEraValue field I had originally placed in
+       GregorianCalendar appears to be in Calendar (as running
+       nunit-2.2.8-2.0 shows.)
+
+       In GregorianCalendar, rename the M_CalendarType field to m_type
+       and remove the extra field I added.
+       
+       The previous fix got nunit 2.4-2.0 running.  This change gets
+       versions 2.2.8 and 2.4 of nunit running against both 1.1 and 2.0
+       profiles.
+
 2006-01-24  Chris Toshok  <toshok@ximian.com>
 
        [ these fix nunit built with MS .net 2.0, running on mono.  nunit
index 49f0aa468e61d73ec164e0148129e596a2df675b..950d6deef7080a143c2e334c4cbaefb978fa5aed 100644 (file)
@@ -81,18 +81,18 @@ public class GregorianCalendar : Calendar {
        /// <see cref="T:System.Globalization.GregorianCalendarTypes"/>.
        /// </summary>
        [NonSerialized]
-       internal GregorianCalendarTypes M_CalendarType;
+       internal GregorianCalendarTypes m_type;
 
        /// <value>
        /// The property stores the 
        /// <see cref="T:System.Globalization.GregorianCalendarTypes"/>.
        /// </value>
        public virtual GregorianCalendarTypes CalendarType {
-               get { return M_CalendarType; }
+               get { return m_type; }
                set { 
                        CheckReadOnly ();
                        // mscorlib 1:0:3300:0 doesn't check anything here
-                       M_CalendarType = value;
+                       m_type = value;
                }
        }
 
@@ -482,8 +482,8 @@ public class GregorianCalendar : Calendar {
                CalendarType = type;
                M_AbbrEraNames = new string[] {"C.E."};
                M_EraNames = new string[] {"Common Era"};
-               if (M_TwoDigitYearMax == 99)
-                       M_TwoDigitYearMax = 2029;
+               if (twoDigitYearMax == 99)
+                       twoDigitYearMax = 2029;
        }
        
 #if NET_2_0
@@ -507,9 +507,6 @@ public class GregorianCalendar : Calendar {
                        return Max;
                }
        }
-
-       private int m_type; // Unused, by MS serializes this
-       private int m_currentEraValue; // Unused, by MS serializes this
 #endif
        
        /// <summary>
index 80fc761f9b98b84404bdc4cd2ec59080ad73b828..81263fce0c43378650f97e68598966685c6f0298 100644 (file)
@@ -51,8 +51,8 @@ public class HebrewCalendar : Calendar {
        public HebrewCalendar() {
                M_AbbrEraNames = new string[] {"A.M."};
                M_EraNames = new string[] {"Anno Mundi"};
-               if (M_TwoDigitYearMax == 99)
-                       M_TwoDigitYearMax = 5790;
+               if (twoDigitYearMax == 99)
+                       twoDigitYearMax = 5790;
        }
 
        /// <summary>
index 6ad09f02080ef379f006a4f3638998e0cae2194f..5ff327a48ed0969a539bc0c8942120cae5927841 100644 (file)
@@ -61,8 +61,8 @@ public class HijriCalendar : Calendar {
        public HijriCalendar() {
                M_AbbrEraNames = new string[] {"A.H."};
                M_EraNames = new string[] {"Anno Hegirae"};
-               if (M_TwoDigitYearMax == 99)
-                       M_TwoDigitYearMax = 1451;
+               if (twoDigitYearMax == 99)
+                       twoDigitYearMax = 1451;
        }
 
        /// <summary>
index 2c241788162aff04ec1bcfbe51934fb845555ee6..8200940c1d4220445e01e7cec1e89c2ba584cbd2 100644 (file)
@@ -50,8 +50,8 @@ public class JulianCalendar : Calendar {
        public JulianCalendar() {
                M_AbbrEraNames = new string[] {"C.E."};
                M_EraNames = new string[] {"Common Era"};
-               if (M_TwoDigitYearMax == 99)
-                       M_TwoDigitYearMax = 2029;
+               if (twoDigitYearMax == 99)
+                       twoDigitYearMax = 2029;
        }
                
        /// <summary>
index 2e1dc413453290f26dcc685aaa77a64804683a50..1fa9d9c29f314632b3bf934e2329a9bbbe1c7d93 100644 (file)
@@ -69,8 +69,8 @@ public class KoreanCalendar : Calendar {
        public KoreanCalendar() {
                M_AbbrEraNames = new string[] {"K.C.E."};
                M_EraNames = new string[] {"Korean Current Era"};
-               if (M_TwoDigitYearMax == 99)
-                       M_TwoDigitYearMax = 4362;
+               if (twoDigitYearMax == 99)
+                       twoDigitYearMax = 4362;
        }
 
        /// <value>Overridden. Gives the eras supported by the
index a25ed2eab98a6918158c02f8d98d9fa0b5e4460e..a5de9022a27fe127e24eade2d9012356b405e060 100644 (file)
@@ -72,10 +72,10 @@ public class PersianCalendar : Calendar {
        public PersianCalendar() {
                M_AbbrEraNames = new string[] {"A.P."};
                M_EraNames = new string[] {"Anno Persico"};
-               if (M_TwoDigitYearMax == 99)
+               if (twoDigitYearMax == 99)
                        // FIXME: the .NET documentation does not mention the default value,
                        // This is the value mentioned in the .NET documentation example result.
-                       M_TwoDigitYearMax = 1410;
+                       twoDigitYearMax = 1410;
        }
 
        /// <summary>
index b7291cd159a199fec414c2315c0ba0b932ac365b..896267c84777cc0b24536b6738b8bda325869e76 100644 (file)
@@ -69,8 +69,8 @@ public class ThaiBuddhistCalendar : Calendar {
        public ThaiBuddhistCalendar() {
                M_AbbrEraNames = new string[] {"T.B.C.E."};
                M_EraNames = new string[] {"ThaiBuddhist current era"};
-               if (M_TwoDigitYearMax == 99)
-                       M_TwoDigitYearMax = 2572;
+               if (twoDigitYearMax == 99)
+                       twoDigitYearMax = 2572;
        }
 
        /// <value>Overridden. Gives the eras supported by the