beagle r4521 - in branches/beagle-lucene2_1/beagled/Lucene.Net: . Analysis/Standard Document Index QueryParser Store Util upstream-changes



Author: dbera
Date: Sat Feb 23 02:00:42 2008
New Revision: 4521
URL: http://svn.gnome.org/viewvc/beagle?rev=4521&view=rev

Log:
Remove a bunch of warnings. Also remove SupportClass.AppSettings entirely and replace System.Configuration.ConfigurationSettings.AppSettings with fixed values since we do not use any AppSettings.


Added:
   branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/12_remove-warnings-appsettings.patch
Modified:
   branches/beagle-lucene2_1/beagled/Lucene.Net/Analysis/Standard/ParseException.cs
   branches/beagle-lucene2_1/beagled/Lucene.Net/Document/DateTools.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/Util/Constants.cs

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Analysis/Standard/ParseException.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Analysis/Standard/ParseException.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Analysis/Standard/ParseException.cs	Sat Feb 23 02:00:42 2008
@@ -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
+}

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 02:00:42 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/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 02:00:42 2008
@@ -725,7 +725,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)
@@ -746,4 +746,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 02:00:42 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 02:00:42 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;
@@ -313,47 +313,13 @@
 					// Locks are disabled:
 					lockFactory = NoLockFactory.GetNoLockFactory();
 				}
+				// D Bera: Ignore system property Lucene.Net.Store.FSDirectoryLockFactoryClass
 				else
 				{
-					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);
-						}
-						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)
-                        {
-                            throw new System.IO.IOException("InstantiationException when instantiating LockClass " + lockClassName);
-                        }
-                    }
-					else
-					{
-						// Our default lock is SimpleFSLockFactory;
-						// default lockDir is our index directory:
-						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 @@
 			{
 				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 02:00:42 2008
@@ -620,60 +620,6 @@
         }
     }
 
-    /// <summary>
-    /// 
-    /// </summary>
-    public class AppSettings
-    {
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        /// <returns></returns>
-        public static int Get(System.String key, int defValue)
-        {
-            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)
-        {
-            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)
-        {
-            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;
@@ -724,7 +670,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"); 
 
@@ -736,4 +682,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Util/Constants.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Util/Constants.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Util/Constants.cs	Sat Feb 23 02:00:42 2008
@@ -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
+}

Added: branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/12_remove-warnings-appsettings.patch
==============================================================================
--- (empty file)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/12_remove-warnings-appsettings.patch	Sat Feb 23 02:00:42 2008
@@ -0,0 +1,292 @@
+Remove a bunch of warnings. Also remove SupportClass.AppSettings entirely and replace System.Configuration.ConfigurationSettings.AppSettings with fixed values since we do not use any AppSettings.
+
+From: D Bera <dbera web gmail com>
+
+Index: QueryParser/ParseException.cs
+===================================================================
+--- QueryParser/ParseException.cs	(revision 4506)
++++ 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: 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	(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;
+@@ -313,47 +313,13 @@
+ 					// Locks are disabled:
+ 					lockFactory = NoLockFactory.GetNoLockFactory();
+ 				}
++				// D Bera: Ignore system property Lucene.Net.Store.FSDirectoryLockFactoryClass
+ 				else
+ 				{
+-					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);
+-						}
+-						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)
+-                        {
+-                            throw new System.IO.IOException("InstantiationException when instantiating LockClass " + lockClassName);
+-                        }
+-                    }
+-					else
+-					{
+-						// Our default lock is SimpleFSLockFactory;
+-						// default lockDir is our index directory:
+-						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 @@
+ 			{
+ 				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 4506)
++++ SupportClass.cs	(working copy)
+@@ -620,60 +620,6 @@
+         }
+     }
+ 
+-    /// <summary>
+-    /// 
+-    /// </summary>
+-    public class AppSettings
+-    {
+-        /// <summary>
+-        /// 
+-        /// </summary>
+-        /// <param name="key"></param>
+-        /// <param name="defValue"></param>
+-        /// <returns></returns>
+-        public static int Get(System.String key, int defValue)
+-        {
+-            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)
+-        {
+-            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)
+-        {
+-            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;
+@@ -724,7 +670,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"); 
+ 
+@@ -736,4 +682,4 @@
+             }
+         }
+     }
+-}
+\ No newline at end of file
++}
+Index: Index/SegmentReader.cs
+===================================================================
+--- Index/SegmentReader.cs	(revision 4506)
++++ Index/SegmentReader.cs	(working copy)
+@@ -725,7 +725,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)
+@@ -746,4 +746,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	(working copy)
+@@ -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
++}



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