lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r582684 - in /incubator/lucene.net/trunk/C#/src/Lucene.Net: Document/NumberTools.cs Index/IndexFileNames.cs Index/IndexWriter.cs Index/SegmentInfos.cs
Date Sun, 07 Oct 2007 21:22:26 GMT
Author: aroush
Date: Sun Oct  7 14:22:26 2007
New Revision: 582684

URL: http://svn.apache.org/viewvc?rev=582684&view=rev
Log:
Fix: LUCENENET-101 "Using incorrect base when opening index"

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/NumberTools.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileNames.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/NumberTools.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/NumberTools.cs?rev=582684&r1=582683&r2=582684&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/NumberTools.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/NumberTools.cs Sun Oct  7 14:22:26
2007
@@ -45,16 +45,16 @@
 		// NB: NEGATIVE_PREFIX must be < POSITIVE_PREFIX
 		private const char POSITIVE_PREFIX = '0';
 		
-		//NB: this must be less than
+		// NB: this must be less than
 		/// <summary> Equivalent to longToString(Long.MIN_VALUE)</summary>
-#if !LUCENE_NET_COMPATIBLE
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
         public static readonly System.String MIN_STRING_VALUE = NEGATIVE_PREFIX + "0000000000000";
 #else
         public static readonly System.String MIN_STRING_VALUE = NEGATIVE_PREFIX + "0000000000000000";
 #endif
 		
 		/// <summary> Equivalent to longToString(Long.MAX_VALUE)</summary>
-#if !LUCENE_NET_COMPATIBLE
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
 		public static readonly System.String MAX_STRING_VALUE = POSITIVE_PREFIX + "1y2p0ij32e8e7";
 #else
         public static readonly System.String MAX_STRING_VALUE = POSITIVE_PREFIX + "7fffffffffffffff";
@@ -84,7 +84,7 @@
 			{
 				buf.Append(POSITIVE_PREFIX);
 			}
-#if !LUCENE_NET_COMPATIBLE
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
 			System.String num = ToString(l);
 #else
             System.String num = System.Convert.ToString(l, RADIX);
@@ -128,7 +128,7 @@
 			}
 			
 			char prefix = str[0];
-#if !LUCENE_NET_COMPATIBLE
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
 			long l = ToLong(str.Substring(1));
 #else
             long l = System.Convert.ToInt64(str.Substring(1), RADIX);
@@ -150,7 +150,7 @@
 			return l;
 		}
 
-#if !LUCENE_NET_COMPATIBLE
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
         #region BASE36 OPS 
         static System.String digits = "0123456789abcdefghijklmnopqrstuvwxyz";
         static long[] powersOf36 = 

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileNames.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexFileNames.cs?rev=582684&r1=582683&r2=582684&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileNames.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileNames.cs Sun Oct  7 14:22:26
2007
@@ -83,7 +83,11 @@
 			}
 			else
 			{
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
+                return base_Renamed + "_" + Lucene.Net.Documents.NumberTools.ToString(gen)
+ extension;
+#else
 				return base_Renamed + "_" + System.Convert.ToString(gen, 16) + extension;
+#endif
 			}
 		}
 	}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexWriter.cs?rev=582684&r1=582683&r2=582684&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs Sun Oct  7 14:22:26
2007
@@ -907,7 +907,11 @@
 		{
 			lock (this)
 			{
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
+                return "_ram_" + Lucene.Net.Documents.NumberTools.ToString(ramSegmentInfos.counter++);
+#else
 				return "_ram_" + System.Convert.ToString(ramSegmentInfos.counter++, 16);
+#endif
 			}
 		}
 		
@@ -949,7 +953,11 @@
 		{
 			lock (this)
 			{
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
+                return "_" + Lucene.Net.Documents.NumberTools.ToString(segmentInfos.counter++);
+#else
 				return "_" + System.Convert.ToString(segmentInfos.counter++, 16);
+#endif
 			}
 		}
 		

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/SegmentInfos.cs?rev=582684&r1=582683&r2=582684&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs Sun Oct  7 14:22:26
2007
@@ -162,7 +162,11 @@
 					}
 					else
 					{
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
+                        long v = Lucene.Net.Documents.NumberTools.ToLong(file.Substring(prefixLen));
+#else
 						long v = System.Convert.ToInt64(file.Substring(prefixLen), 16);
+#endif
 						if (v > max)
 						{
 							max = v;
@@ -254,7 +258,11 @@
 			}
 			else
 			{
+#if !PRE_LUCENE_NET_2_0_0_COMPATIBLE
+                generation = Lucene.Net.Documents.NumberTools.ToLong(segmentFileName.Substring(1
+ IndexFileNames.SEGMENTS.Length));
+#else
 				generation = System.Convert.ToInt64(segmentFileName.Substring(1 + IndexFileNames.SEGMENTS.Length),
16);
+#endif
 			}
 			lastGeneration = generation;
 			



Mime
View raw message