You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2009/11/18 19:23:59 UTC

svn commit: r881861 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs

Author: digy
Date: Wed Nov 18 18:23:59 2009
New Revision: 881861

URL: http://svn.apache.org/viewvc?rev=881861&view=rev
Log:
LUCENENET-278 Instances of DateField class cannot be created.

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/DateField.cs?rev=881861&r1=881860&r2=881861&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs Wed Nov 18 18:23:59 2009
@@ -67,8 +67,8 @@
 		}
 		
 		// make date strings long enough to last a millenium
-		private static int DATE_LEN = System.Convert.ToString(1000L * 365 * 24 * 60 * 60 * 1000, 36).Length;
-		
+        private static int DATE_LEN = SupportClass.Number.ToString(1000L * 365 * 24 * 60 * 60 * 1000, SupportClass.Number.MAX_RADIX).Length;
+
 		public static System.String MIN_DATE_STRING()
 		{
 			return TimeToString(0);
@@ -77,7 +77,7 @@
 		public static System.String MAX_DATE_STRING()
 		{
 			char[] buffer = new char[DATE_LEN];
-			char c = SupportClass.Character.ForDigit(36 - 1, SupportClass.Character.MAX_RADIX);
+            char c = SupportClass.Character.ForDigit(SupportClass.Character.MAX_RADIX - 1, SupportClass.Character.MAX_RADIX);
 			for (int i = 0; i < DATE_LEN; i++)
 				buffer[i] = c;
 			return new System.String(buffer);
@@ -101,8 +101,8 @@
 		{
 			if (time < 0)
 				throw new System.SystemException("time '" + time + "' is too early, must be >= 0");
-			
-			System.String s = System.Convert.ToString(time, 36);
+
+            System.String s = SupportClass.Number.ToString(time, SupportClass.Character.MAX_RADIX);
 			
 			if (s.Length > DATE_LEN)
 				throw new System.SystemException("time '" + time + "' is too late, length of string " + "representation must be <= " + DATE_LEN);
@@ -122,7 +122,7 @@
 		/// <summary>Converts a string-encoded date into a millisecond time. </summary>
 		public static long StringToTime(System.String s)
 		{
-			return System.Convert.ToInt64(s, 36);
+            return System.Convert.ToInt64(s, SupportClass.Character.MAX_RADIX);
 		}
 		/// <summary>Converts a string-encoded date into a Date object. </summary>
 		public static System.DateTime StringToDate(System.String s)