beagle r4530 - in branches/beagle-lucene2_1/beagled/Lucene.Net: . Document Index QueryParser Store upstream-changes



Author: dbera
Date: Sat Feb 23 15:54:19 2008
New Revision: 4530
URL: http://svn.gnome.org/viewvc/beagle?rev=4530&view=rev

Log:
Drop some of our upstream patches since they have been applied upstream and hand patch some of the patches for 2.1-0.003.


Removed:
   branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/15_lucene-bug-filesystementries.patch
Modified:
   branches/beagle-lucene2_1/beagled/Lucene.Net/Document/DateTools.cs
   branches/beagle-lucene2_1/beagled/Lucene.Net/Index/IndexWriter.cs
   branches/beagle-lucene2_1/beagled/Lucene.Net/Index/SegmentInfos.cs
   branches/beagle-lucene2_1/beagled/Lucene.Net/Index/SegmentReader.cs
   branches/beagle-lucene2_1/beagled/Lucene.Net/QueryParser/ParseException.cs
   branches/beagle-lucene2_1/beagled/Lucene.Net/Store/FSDirectory.cs
   branches/beagle-lucene2_1/beagled/Lucene.Net/SupportClass.cs
   branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/12_remove-warnings-appsettings.patch

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Document/DateTools.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Document/DateTools.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Document/DateTools.cs	Sat Feb 23 15:54:19 2008
@@ -106,35 +106,35 @@
 			{
 				lock (DAY_FORMAT)
 				{
-					result = result = dt.ToString(DAY_FORMAT);
+					result = dt.ToString(DAY_FORMAT);
 				}
 			}
 			else if (resolution == Resolution.HOUR)
 			{
 				lock (HOUR_FORMAT)
 				{
-					result = result = dt.ToString(HOUR_FORMAT);
+					result = dt.ToString(HOUR_FORMAT);
 				}
 			}
 			else if (resolution == Resolution.MINUTE)
 			{
 				lock (MINUTE_FORMAT)
 				{
-					result = result = dt.ToString(MINUTE_FORMAT);
+					result = dt.ToString(MINUTE_FORMAT);
 				}
 			}
 			else if (resolution == Resolution.SECOND)
 			{
 				lock (SECOND_FORMAT)
 				{
-					result = result = dt.ToString(SECOND_FORMAT);
+					result = dt.ToString(SECOND_FORMAT);
 				}
 			}
 			else if (resolution == Resolution.MILLISECOND)
 			{
 				lock (MILLISECOND_FORMAT)
 				{
-					result = result = dt.ToString(MILLISECOND_FORMAT);
+					result = dt.ToString(MILLISECOND_FORMAT);
 				}
 			}
 			else
@@ -390,4 +390,4 @@
 			}
 		}
 	}
-}
\ No newline at end of file
+}

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Index/IndexWriter.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Index/IndexWriter.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Index/IndexWriter.cs	Sat Feb 23 15:54:19 2008
@@ -95,7 +95,7 @@
 		public const int DEFAULT_MERGE_FACTOR = 10;
 		
 		/// <summary> Default value is 10. Change using { link #SetMaxBufferedDocs(int)}.</summary>
-		public const int DEFAULT_MAX_BUFFERED_DOCS = 10;
+		public const int DEFAULT_MAX_BUFFERED_DOCS = 30;
 		
 		/// <summary> Default value is 1000. Change using
 		/// { link #SetMaxBufferedDeleteTerms(int)}.
@@ -711,8 +711,6 @@
 					writeLock.Release(); // release write lock
 					writeLock = null;
 				}
-
-				segmentInfos.Optimize (directory);
 			}
 			finally
 			{
@@ -1078,6 +1076,8 @@
 					int minSegment = segmentInfos.Count - mergeFactor;
 					MergeSegments(segmentInfos, minSegment < 0?0:minSegment, segmentInfos.Count);
 				}
+
+				segmentInfos.Optimize (directory);
 			}
 		}
 		

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Index/SegmentInfos.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Index/SegmentInfos.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Index/SegmentInfos.cs	Sat Feb 23 15:54:19 2008
@@ -755,6 +755,7 @@
 			string[] files = directory.List();
 
 			System.Collections.ArrayList segment_names = new System.Collections.ArrayList();
+
 			foreach (SegmentInfo si in this)
 				segment_names.Add (si.name);
 
@@ -763,11 +764,14 @@
 				if (segment_names.Contains (basename))
 					continue;
 
-				if (basename == IndexFileNames.DELETABLE || basename == IndexFileNames.SEGMENTS)
+				// Allowed files deletable, segments, segments.gen, segments_N
+				if (basename == IndexFileNames.DELETABLE || basename.StartsWith (IndexFileNames.SEGMENTS))
 					continue;
 
 				Console.WriteLine ("WARNING! Deleting stale data {0}", file);
-				directory.DeleteFile (file);
+				try {
+					directory.DeleteFile (file);
+				} catch { /* Could be already deleted. */ }
 			}
 		}
 	}

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Index/SegmentReader.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Index/SegmentReader.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Index/SegmentReader.cs	Sat Feb 23 15:54:19 2008
@@ -731,7 +731,7 @@
 			{
 				try
 				{
-					System.String name = SupportClass.AppSettings.Get("Lucene.Net.SegmentReader.class", typeof(SegmentReader).FullName);
+					System.String name = typeof(SegmentReader).FullName;
 					IMPL = System.Type.GetType(name);
 				}
                 catch (System.Security.SecurityException se)
@@ -752,4 +752,4 @@
 			}
 		}
 	}
-}
\ No newline at end of file
+}

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/QueryParser/ParseException.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/QueryParser/ParseException.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/QueryParser/ParseException.cs	Sat Feb 23 15:54:19 2008
@@ -161,7 +161,7 @@
 		public System.String[] tokenImage;
 		
 		/// <summary> The end of line string for this machine.</summary>
-		protected internal System.String eol = SupportClass.AppSettings.Get("line.separator", "\n");
++		protected internal System.String eol = System.Environment.NewLine;
 		
 		/// <summary> Used to convert raw characters to their escaped version
 		/// when these raw version cannot be used as part of an ASCII
@@ -228,4 +228,4 @@
 			return retval.ToString();
 		}
 	}
-}
\ No newline at end of file
+}

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Store/FSDirectory.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Store/FSDirectory.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Store/FSDirectory.cs	Sat Feb 23 15:54:19 2008
@@ -89,7 +89,7 @@
 		/// the <code>getDirectory</code> methods that take a
 		/// <code>lockFactory</code> (for example, { link #GetDirectory(String, LockFactory)}).
 		/// </deprecated>
-		public static readonly System.String LOCK_DIR = SupportClass.AppSettings.Get("Lucene.Net.lockDir", System.IO.Path.GetTempPath());
++		/// REMOVED - D Bera
 		
 		/// <summary>The default class which implements filesystem-based directories. </summary>
 		private static System.Type IMPL;
@@ -315,54 +315,11 @@
 				}
 				else
 				{
+					// Our default lock is SimpleFSLockFactory;
+					// default lockDir is our index directory:
+					lockFactory = new SimpleFSLockFactory(path);
+					doClearLockID = true;
 					System.String lockClassName = SupportClass.AppSettings.Get("Lucene.Net.Store.FSDirectoryLockFactoryClass", "");
-					
-					if (lockClassName != null && !lockClassName.Equals(""))
-					{
-						System.Type c;
-						
-						try
-						{
-							c = System.Type.GetType(lockClassName);
-						}
-						catch (System.Exception)
-						{
-							throw new System.IO.IOException("unable to find LockClass " + lockClassName);
-						}
-						
-						try
-						{
-							lockFactory = (LockFactory) System.Activator.CreateInstance(c, true);
-						}
-						catch (System.UnauthorizedAccessException e)
-						{
-							throw new System.IO.IOException("IllegalAccessException when instantiating LockClass " + lockClassName);
-						}
-						catch (System.InvalidCastException)
-						{
-							throw new System.IO.IOException("unable to cast LockClass " + lockClassName + " instance to a LockFactory");
-						}
-                        catch (System.Exception ex)
-                        {
-                            throw new System.IO.IOException("InstantiationException when instantiating LockClass " + lockClassName + "\nDetails:" + ex.Message);
-                        }
-
-                        if (lockFactory is NativeFSLockFactory)
-                        {
-                            ((NativeFSLockFactory) lockFactory).SetLockDir(path);
-                        }
-                        else if (lockFactory is SimpleFSLockFactory)
-                        {
-                            ((SimpleFSLockFactory) lockFactory).SetLockDir(path);
-                        }
-                    }
-					else
-					{
-						// Our default lock is SimpleFSLockFactory;
-						// default lockDir is our index directory:
-						lockFactory = new SimpleFSLockFactory(path);
-						doClearLockID = true;
-					}
 				}
 			}
 			
@@ -675,7 +632,7 @@
 			{
 				try
 				{
-					System.String name = SupportClass.AppSettings.Get("Lucene.Net.FSDirectory.class", typeof(FSDirectory).FullName);
+					System.String name = typeof(FSDirectory).FullName;
 					IMPL = System.Type.GetType(name);
 				}
 				catch (System.Security.SecurityException)

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/SupportClass.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/SupportClass.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/SupportClass.cs	Sat Feb 23 15:54:19 2008
@@ -681,107 +681,6 @@
         }
     }
 
-    /// <summary>
-    /// 
-    /// </summary>
-    public class AppSettings
-    {
-        static System.Collections.Specialized.ListDictionary settings = new System.Collections.Specialized.ListDictionary();
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        public static void Set(System.String key, int defValue)
-        {
-            settings[key] = defValue;
-        }
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        public static void Set(System.String key, long defValue)
-        {
-            settings[key] = defValue;
-        }
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="Key"></param>
-        /// <param name="Value"></param>
-        public static void Set(System.String key, System.String defValue)
-        {
-            settings[key] = defValue;
-        }
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        /// <returns></returns>
-        public static int Get(System.String key, int defValue)
-        {
-            if (settings[key] != null)
-            {
-                return (int) settings[key];
-            }
-
-            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
-            if (theValue == null)
-            {
-                return defValue;
-            }
-            return System.Convert.ToInt16(theValue.Trim());
-        }
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        /// <returns></returns>
-        public static long Get(System.String key, long defValue)
-        {
-            if (settings[key] != null)
-            {
-                return (long) settings[key];
-            }
-
-            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
-            if (theValue == null)
-            {
-                return defValue;
-            }
-            return System.Convert.ToInt32(theValue.Trim());
-        }
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        /// <returns></returns>
-        public static System.String Get(System.String key, System.String defValue)
-        {
-            if (settings[key] != null)
-            {
-                return (System.String) settings[key];
-            }
-
-            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
-            if (theValue == null)
-            {
-                return defValue;
-            }
-            return theValue;
-        }
-    }
-
     public static System.Collections.SortedList TailMap(System.Collections.SortedList list, System.Object limit)
     {
         System.Collections.Comparer comparer = System.Collections.Comparer.Default;
@@ -880,7 +779,7 @@
         {
             if (compressionAdapter == null)
             {
-                System.String compressionLibClassName = SupportClass.AppSettings.Get("Lucene.Net.CompressionLib.class", null);
+                System.String compressionLibClassName = null;
                 if (compressionLibClassName == null)
                     throw new System.SystemException("Compression support not configured"); 
 
@@ -892,4 +791,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/12_remove-warnings-appsettings.patch
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/12_remove-warnings-appsettings.patch	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/12_remove-warnings-appsettings.patch	Sat Feb 23 15:54:19 2008
@@ -4,14 +4,14 @@
 
 Index: QueryParser/ParseException.cs
 ===================================================================
---- QueryParser/ParseException.cs	(revision 4506)
+--- QueryParser/ParseException.cs	(revision 4529)
 +++ QueryParser/ParseException.cs	(working copy)
 @@ -161,7 +161,7 @@
  		public System.String[] tokenImage;
  		
  		/// <summary> The end of line string for this machine.</summary>
 -		protected internal System.String eol = SupportClass.AppSettings.Get("line.separator", "\n");
-+		protected internal System.String eol = System.Environment.NewLine;
+++		protected internal System.String eol = System.Environment.NewLine;
  		
  		/// <summary> Used to convert raw characters to their escaped version
  		/// when these raw version cannot be used as part of an ASCII
@@ -22,47 +22,28 @@
 -}
 \ No newline at end of file
 +}
-Index: Analysis/Standard/ParseException.cs
-===================================================================
---- Analysis/Standard/ParseException.cs	(revision 4506)
-+++ Analysis/Standard/ParseException.cs	(working copy)
-@@ -141,7 +141,7 @@
- 		public System.String[] tokenImage;
- 		
- 		/// <summary> The end of line string for this machine.</summary>
--		protected internal System.String eol = SupportClass.AppSettings.Get("line.separator", "\n");
-+		protected internal System.String eol = System.Environment.NewLine;
- 		
- 		/// <summary> Used to convert raw characters to their escaped version
- 		/// when these raw version cannot be used as part of an ASCII
-@@ -208,4 +208,4 @@
- 			return retval.ToString();
- 		}
- 	}
--}
-\ No newline at end of file
-+}
 Index: Store/FSDirectory.cs
 ===================================================================
---- Store/FSDirectory.cs	(revision 4510)
+--- Store/FSDirectory.cs	(revision 4529)
 +++ Store/FSDirectory.cs	(working copy)
 @@ -89,7 +89,7 @@
  		/// the <code>getDirectory</code> methods that take a
  		/// <code>lockFactory</code> (for example, { link #GetDirectory(String, LockFactory)}).
  		/// </deprecated>
 -		public static readonly System.String LOCK_DIR = SupportClass.AppSettings.Get("Lucene.Net.lockDir", System.IO.Path.GetTempPath());
-+		/// REMOVED - D Bera
+++		/// REMOVED - D Bera
  		
  		/// <summary>The default class which implements filesystem-based directories. </summary>
  		private static System.Type IMPL;
-@@ -313,47 +313,13 @@
- 					// Locks are disabled:
- 					lockFactory = NoLockFactory.GetNoLockFactory();
+@@ -315,54 +315,11 @@
  				}
-+				// D Bera: Ignore system property Lucene.Net.Store.FSDirectoryLockFactoryClass
  				else
  				{
--					System.String lockClassName = SupportClass.AppSettings.Get("Lucene.Net.Store.FSDirectoryLockFactoryClass", "");
++					// Our default lock is SimpleFSLockFactory;
++					// default lockDir is our index directory:
++					lockFactory = new SimpleFSLockFactory(path);
++					doClearLockID = true;
+ 					System.String lockClassName = SupportClass.AppSettings.Get("Lucene.Net.Store.FSDirectoryLockFactoryClass", "");
 -					
 -					if (lockClassName != null && !lockClassName.Equals(""))
 -					{
@@ -79,7 +60,7 @@
 -						
 -						try
 -						{
--							lockFactory = (LockFactory) System.Activator.CreateInstance(c);
+-							lockFactory = (LockFactory) System.Activator.CreateInstance(c, true);
 -						}
 -						catch (System.UnauthorizedAccessException e)
 -						{
@@ -89,9 +70,18 @@
 -						{
 -							throw new System.IO.IOException("unable to cast LockClass " + lockClassName + " instance to a LockFactory");
 -						}
--                        catch (System.Exception)
+-                        catch (System.Exception ex)
+-                        {
+-                            throw new System.IO.IOException("InstantiationException when instantiating LockClass " + lockClassName + "\nDetails:" + ex.Message);
+-                        }
+-
+-                        if (lockFactory is NativeFSLockFactory)
 -                        {
--                            throw new System.IO.IOException("InstantiationException when instantiating LockClass " + lockClassName);
+-                            ((NativeFSLockFactory) lockFactory).SetLockDir(path);
+-                        }
+-                        else if (lockFactory is SimpleFSLockFactory)
+-                        {
+-                            ((SimpleFSLockFactory) lockFactory).SetLockDir(path);
 -                        }
 -                    }
 -					else
@@ -101,14 +91,10 @@
 -						lockFactory = new SimpleFSLockFactory(path);
 -						doClearLockID = true;
 -					}
-+					// Our default lock is SimpleFSLockFactory;
-+					// default lockDir is our index directory:
-+					lockFactory = new SimpleFSLockFactory(path);
-+					doClearLockID = true;
  				}
  			}
  			
-@@ -666,7 +632,7 @@
+@@ -675,7 +632,7 @@
  			{
  				try
  				{
@@ -119,9 +105,9 @@
  				catch (System.Security.SecurityException)
 Index: SupportClass.cs
 ===================================================================
---- SupportClass.cs	(revision 4506)
+--- SupportClass.cs	(revision 4529)
 +++ SupportClass.cs	(working copy)
-@@ -620,60 +620,6 @@
+@@ -681,107 +681,6 @@
          }
      }
  
@@ -130,6 +116,38 @@
 -    /// </summary>
 -    public class AppSettings
 -    {
+-        static System.Collections.Specialized.ListDictionary settings = new System.Collections.Specialized.ListDictionary();
+-
+-        /// <summary>
+-        /// 
+-        /// </summary>
+-        /// <param name="key"></param>
+-        /// <param name="defValue"></param>
+-        public static void Set(System.String key, int defValue)
+-        {
+-            settings[key] = defValue;
+-        }
+-
+-        /// <summary>
+-        /// 
+-        /// </summary>
+-        /// <param name="key"></param>
+-        /// <param name="defValue"></param>
+-        public static void Set(System.String key, long defValue)
+-        {
+-            settings[key] = defValue;
+-        }
+-
+-        /// <summary>
+-        /// 
+-        /// </summary>
+-        /// <param name="Key"></param>
+-        /// <param name="Value"></param>
+-        public static void Set(System.String key, System.String defValue)
+-        {
+-            settings[key] = defValue;
+-        }
+-
 -        /// <summary>
 -        /// 
 -        /// </summary>
@@ -138,6 +156,11 @@
 -        /// <returns></returns>
 -        public static int Get(System.String key, int defValue)
 -        {
+-            if (settings[key] != null)
+-            {
+-                return (int) settings[key];
+-            }
+-
 -            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
 -            if (theValue == null)
 -            {
@@ -154,6 +177,11 @@
 -        /// <returns></returns>
 -        public static long Get(System.String key, long defValue)
 -        {
+-            if (settings[key] != null)
+-            {
+-                return (long) settings[key];
+-            }
+-
 -            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
 -            if (theValue == null)
 -            {
@@ -170,6 +198,11 @@
 -        /// <returns></returns>
 -        public static System.String Get(System.String key, System.String defValue)
 -        {
+-            if (settings[key] != null)
+-            {
+-                return (System.String) settings[key];
+-            }
+-
 -            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
 -            if (theValue == null)
 -            {
@@ -182,7 +215,7 @@
      public static System.Collections.SortedList TailMap(System.Collections.SortedList list, System.Object limit)
      {
          System.Collections.Comparer comparer = System.Collections.Comparer.Default;
-@@ -724,7 +670,7 @@
+@@ -880,7 +779,7 @@
          {
              if (compressionAdapter == null)
              {
@@ -191,18 +224,258 @@
                  if (compressionLibClassName == null)
                      throw new System.SystemException("Compression support not configured"); 
  
-@@ -736,4 +682,4 @@
+@@ -892,4 +791,4 @@
              }
          }
      }
 -}
 \ No newline at end of file
 +}
+Index: upstream-changes/12_remove-warnings-appsettings.patch
+===================================================================
+--- upstream-changes/12_remove-warnings-appsettings.patch	(revision 4521)
++++ upstream-changes/12_remove-warnings-appsettings.patch	(working copy)
+@@ -290,3 +290,235 @@
+ -}
+ \ No newline at end of file
+ +}
++***********************************
++Index: QueryParser/ParseException.cs
++===================================================================
++--- QueryParser/ParseException.cs	(revision 4529)
+++++ QueryParser/ParseException.cs	(working copy)
++@@ -161,7 +161,7 @@
++ 		public System.String[] tokenImage;
++ 		
++ 		/// <summary> The end of line string for this machine.</summary>
++-		protected internal System.String eol = SupportClass.AppSettings.Get("line.separator", "\n");
++++		protected internal System.String eol = System.Environment.NewLine;
++ 		
++ 		/// <summary> Used to convert raw characters to their escaped version
++ 		/// when these raw version cannot be used as part of an ASCII
++@@ -228,4 +228,4 @@
++ 			return retval.ToString();
++ 		}
++ 	}
++-}
++\ No newline at end of file
+++}
++Index: Store/FSDirectory.cs
++===================================================================
++--- Store/FSDirectory.cs	(revision 4529)
+++++ Store/FSDirectory.cs	(working copy)
++@@ -89,7 +89,7 @@
++ 		/// the <code>getDirectory</code> methods that take a
++ 		/// <code>lockFactory</code> (for example, { link #GetDirectory(String, LockFactory)}).
++ 		/// </deprecated>
++-		public static readonly System.String LOCK_DIR = SupportClass.AppSettings.Get("Lucene.Net.lockDir", System.IO.Path.GetTempPath());
++++		/// REMOVED - D Bera
++ 		
++ 		/// <summary>The default class which implements filesystem-based directories. </summary>
++ 		private static System.Type IMPL;
++@@ -315,54 +315,11 @@
++ 				}
++ 				else
++ 				{
+++					// Our default lock is SimpleFSLockFactory;
+++					// default lockDir is our index directory:
+++					lockFactory = new SimpleFSLockFactory(path);
+++					doClearLockID = true;
++ 					System.String lockClassName = SupportClass.AppSettings.Get("Lucene.Net.Store.FSDirectoryLockFactoryClass", "");
++-					
++-					if (lockClassName != null && !lockClassName.Equals(""))
++-					{
++-						System.Type c;
++-						
++-						try
++-						{
++-							c = System.Type.GetType(lockClassName);
++-						}
++-						catch (System.Exception)
++-						{
++-							throw new System.IO.IOException("unable to find LockClass " + lockClassName);
++-						}
++-						
++-						try
++-						{
++-							lockFactory = (LockFactory) System.Activator.CreateInstance(c, true);
++-						}
++-						catch (System.UnauthorizedAccessException e)
++-						{
++-							throw new System.IO.IOException("IllegalAccessException when instantiating LockClass " + lockClassName);
++-						}
++-						catch (System.InvalidCastException)
++-						{
++-							throw new System.IO.IOException("unable to cast LockClass " + lockClassName + " instance to a LockFactory");
++-						}
++-                        catch (System.Exception ex)
++-                        {
++-                            throw new System.IO.IOException("InstantiationException when instantiating LockClass " + lockClassName + "\nDetails:" + ex.Message);
++-                        }
++-
++-                        if (lockFactory is NativeFSLockFactory)
++-                        {
++-                            ((NativeFSLockFactory) lockFactory).SetLockDir(path);
++-                        }
++-                        else if (lockFactory is SimpleFSLockFactory)
++-                        {
++-                            ((SimpleFSLockFactory) lockFactory).SetLockDir(path);
++-                        }
++-                    }
++-					else
++-					{
++-						// Our default lock is SimpleFSLockFactory;
++-						// default lockDir is our index directory:
++-						lockFactory = new SimpleFSLockFactory(path);
++-						doClearLockID = true;
++-					}
++ 				}
++ 			}
++ 			
++@@ -675,7 +632,7 @@
++ 			{
++ 				try
++ 				{
++-					System.String name = SupportClass.AppSettings.Get("Lucene.Net.FSDirectory.class", typeof(FSDirectory).FullName);
+++					System.String name = typeof(FSDirectory).FullName;
++ 					IMPL = System.Type.GetType(name);
++ 				}
++ 				catch (System.Security.SecurityException)
++Index: SupportClass.cs
++===================================================================
++--- SupportClass.cs	(revision 4529)
+++++ SupportClass.cs	(working copy)
++@@ -681,107 +681,6 @@
++         }
++     }
++ 
++-    /// <summary>
++-    /// 
++-    /// </summary>
++-    public class AppSettings
++-    {
++-        static System.Collections.Specialized.ListDictionary settings = new System.Collections.Specialized.ListDictionary();
++-
++-        /// <summary>
++-        /// 
++-        /// </summary>
++-        /// <param name="key"></param>
++-        /// <param name="defValue"></param>
++-        public static void Set(System.String key, int defValue)
++-        {
++-            settings[key] = defValue;
++-        }
++-
++-        /// <summary>
++-        /// 
++-        /// </summary>
++-        /// <param name="key"></param>
++-        /// <param name="defValue"></param>
++-        public static void Set(System.String key, long defValue)
++-        {
++-            settings[key] = defValue;
++-        }
++-
++-        /// <summary>
++-        /// 
++-        /// </summary>
++-        /// <param name="Key"></param>
++-        /// <param name="Value"></param>
++-        public static void Set(System.String key, System.String defValue)
++-        {
++-            settings[key] = defValue;
++-        }
++-
++-        /// <summary>
++-        /// 
++-        /// </summary>
++-        /// <param name="key"></param>
++-        /// <param name="defValue"></param>
++-        /// <returns></returns>
++-        public static int Get(System.String key, int defValue)
++-        {
++-            if (settings[key] != null)
++-            {
++-                return (int) settings[key];
++-            }
++-
++-            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
++-            if (theValue == null)
++-            {
++-                return defValue;
++-            }
++-            return System.Convert.ToInt16(theValue.Trim());
++-        }
++-
++-        /// <summary>
++-        /// 
++-        /// </summary>
++-        /// <param name="key"></param>
++-        /// <param name="defValue"></param>
++-        /// <returns></returns>
++-        public static long Get(System.String key, long defValue)
++-        {
++-            if (settings[key] != null)
++-            {
++-                return (long) settings[key];
++-            }
++-
++-            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
++-            if (theValue == null)
++-            {
++-                return defValue;
++-            }
++-            return System.Convert.ToInt32(theValue.Trim());
++-        }
++-
++-        /// <summary>
++-        /// 
++-        /// </summary>
++-        /// <param name="key"></param>
++-        /// <param name="defValue"></param>
++-        /// <returns></returns>
++-        public static System.String Get(System.String key, System.String defValue)
++-        {
++-            if (settings[key] != null)
++-            {
++-                return (System.String) settings[key];
++-            }
++-
++-            System.String theValue = System.Configuration.ConfigurationSettings.AppSettings.Get(key);
++-            if (theValue == null)
++-            {
++-                return defValue;
++-            }
++-            return theValue;
++-        }
++-    }
++-
++     public static System.Collections.SortedList TailMap(System.Collections.SortedList list, System.Object limit)
++     {
++         System.Collections.Comparer comparer = System.Collections.Comparer.Default;
++@@ -880,7 +779,7 @@
++         {
++             if (compressionAdapter == null)
++             {
++-                System.String compressionLibClassName = SupportClass.AppSettings.Get("Lucene.Net.CompressionLib.class", null);
+++                System.String compressionLibClassName = null;
++                 if (compressionLibClassName == null)
++                     throw new System.SystemException("Compression support not configured"); 
++ 
++@@ -892,4 +791,4 @@
++             }
++         }
++     }
++-}
++\ No newline at end of file
+++}
++Index: upstream-changes/12_remove-warnings-appsettings.patch
++===================================================================
 Index: Index/SegmentReader.cs
 ===================================================================
---- Index/SegmentReader.cs	(revision 4506)
+--- Index/SegmentReader.cs	(revision 4529)
 +++ Index/SegmentReader.cs	(working copy)
-@@ -725,7 +725,7 @@
+@@ -731,7 +731,7 @@
  			{
  				try
  				{
@@ -211,36 +484,16 @@
  					IMPL = System.Type.GetType(name);
  				}
                  catch (System.Security.SecurityException se)
-@@ -746,4 +746,4 @@
+@@ -752,4 +752,4 @@
  			}
  		}
  	}
 -}
 \ No newline at end of file
 +}
-Index: Util/Constants.cs
-===================================================================
---- Util/Constants.cs	(revision 4506)
-+++ Util/Constants.cs	(working copy)
-@@ -53,7 +53,7 @@
- 		
-         // {{Aroush-2.1 those next constants are Java specific, what's the equivlant in C#?
- 		/// <summary>The value of <tt>System.getProperty("java.version")<tt>. *</summary>
--		public static readonly System.String JAVA_VERSION = System.Configuration.ConfigurationSettings.AppSettings.Get("java.version");     // {{Aroush-1.9}}
-+		public static readonly System.String JAVA_VERSION = String.Empty;     // {{Aroush-1.9}}
- 		/// <summary>True iff this is Java version 1.1. </summary>
- 		public static readonly bool JAVA_1_1 = JAVA_VERSION.StartsWith("1.1.");
- 		/// <summary>True iff this is Java version 1.2. </summary>
-@@ -71,4 +71,4 @@
- 		/// <summary>True iff running on SunOS. </summary>
- 		public static readonly bool SUN_OS = OS_NAME.StartsWith("SunOS");
- 	}
--}
-\ No newline at end of file
-+}
 Index: Document/DateTools.cs
 ===================================================================
---- Document/DateTools.cs	(revision 4506)
+--- Document/DateTools.cs	(revision 4529)
 +++ Document/DateTools.cs	(working copy)
 @@ -106,35 +106,35 @@
  			{



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]