lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1101624 - in /incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core: Analysis/CharArraySet.cs Index/SegmentInfos.cs Messages/NLS.cs Search/Similarity.cs Util/FieldCacheSanityChecker.cs
Date Tue, 10 May 2011 20:08:34 GMT
Author: digy
Date: Tue May 10 20:08:34 2011
New Revision: 1101624

URL: http://svn.apache.org/viewvc?rev=1101624&view=rev
Log:
[LUCENENET-412]

Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Messages/NLS.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/Similarity.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/FieldCacheSanityChecker.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs?rev=1101624&r1=1101623&r2=1101624&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs Tue
May 10 20:08:34 2011
@@ -332,7 +332,7 @@ namespace Lucene.Net.Analysis
         /// <summary>The Iterator&lt;String&gt; for this set.  Strings are
constructed on the fly, so
 		/// use <code>nextCharArray</code> for more efficient access. 
 		/// </summary>
-		public class CharArraySetIterator : System.Collections.IEnumerator
+		internal class CharArraySetIterator : IEnumerator<string>
 		{
 			private void  InitBlock(CharArraySet enclosingInstance)
 			{
@@ -342,7 +342,7 @@ namespace Lucene.Net.Analysis
             /// <summary>Returns the next String, as a Set&lt;String&gt; would...
 			/// use nextCharArray() for better efficiency. 
 			/// </summary>
-			public virtual System.Object Current
+            System.Object System.Collections.IEnumerator.Current
 			{
 				get
 				{
@@ -350,6 +350,15 @@ namespace Lucene.Net.Analysis
 				}
 				
 			}
+
+            public string Current
+            {
+                get
+                {
+                    return new String(NextCharArray());
+                }
+            }
+
 			public CharArraySet Enclosing_Instance
 			{
 				get
@@ -396,10 +405,14 @@ namespace Lucene.Net.Analysis
 			{
                 System.Diagnostics.Debug.Fail("Port issue:", "Need to implement this call,
CharArraySetIterator.Reset()");  // {{Aroush-2.9
 			}
+
+            public void Dispose()
+            {
+            }
 		}
-		
-		
-		public new System.Collections.IEnumerator GetEnumerator()
+
+
+        public new IEnumerator<string> GetEnumerator()
 		{
 			return new CharArraySetIterator(this);
 		}

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs?rev=1101624&r1=1101623&r2=1101624&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs Tue May
10 20:08:34 2011
@@ -1100,7 +1100,7 @@ namespace Lucene.Net.Index
         /// <summary>
         /// Calculate hash code of SegmentInfos
         /// </summary>
-        /// <returns>hash code as in java version of ArrayList</returns>
+        /// <returns>hash code as in java version of List<SegmentInfo></returns>
         public override int GetHashCode()
         {
             int h = 1;

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Messages/NLS.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Messages/NLS.cs?rev=1101624&r1=1101623&r2=1101624&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Messages/NLS.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Messages/NLS.cs Tue May 10 20:08:34
2011
@@ -61,8 +61,8 @@ namespace Lucene.Net.Messages
 				return null;
 			}
 		}
-		
-		private static System.Collections.IDictionary bundles = new System.Collections.Hashtable(0);
+
+        private static Support.Dictionary<string, Type> bundles = new Support.Dictionary<string,
Type>(0);
 		
 		protected internal NLS()
 		{
@@ -115,7 +115,7 @@ namespace Lucene.Net.Messages
 			try
 			{
 				Load(clazz);
-				if (!bundles.Contains(bundleName))
+				if (!bundles.ContainsKey(bundleName))
 					bundles[bundleName] = clazz;
 			}
 			catch (System.Exception e)
@@ -130,9 +130,9 @@ namespace Lucene.Net.Messages
 			
 			// slow resource checking
 			// need to loop thru all registered resource bundles
-			for (System.Collections.IEnumerator it = bundles.Keys.GetEnumerator(); it.MoveNext();
)
+            foreach(string key in bundles.Keys)
 			{
-				System.Type clazz = (System.Type) bundles[(System.String) it.Current];
+				System.Type clazz = bundles[key];
 				System.Threading.Thread.CurrentThread.CurrentUICulture = locale;
                 System.Resources.ResourceManager resourceBundle = System.Resources.ResourceManager.CreateFileBasedResourceManager(clazz.Name,
"Messages", null); //{{Lucene.Net-2.9.1}} Can we make resourceDir "Messages" more general?
 				if (resourceBundle != null)

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/Similarity.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/Similarity.cs?rev=1101624&r1=1101623&r2=1101624&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/Similarity.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/Similarity.cs Tue May
10 20:08:34 2011
@@ -912,7 +912,7 @@ namespace Lucene.Net.Search
 		/// <deprecated> Remove this when old API is removed! 
 		/// </deprecated>
         [Obsolete("Remove this when old API is removed! ")]
-		private static readonly System.Collections.Hashtable knownMethodSupport = new System.Collections.Hashtable();
+        private static readonly Support.Dictionary<Type, MethodSupport> knownMethodSupport
= new Support.Dictionary<Type, MethodSupport>();
 
         // {{Aroush-2.9 Port issue, need to mimic java's IdentityHashMap
         /*
@@ -934,7 +934,7 @@ namespace Lucene.Net.Search
 			MethodSupport supportedMethods;
 			lock (knownMethodSupport)
 			{
-				supportedMethods = (MethodSupport) knownMethodSupport[clazz];
+				supportedMethods = knownMethodSupport[clazz];
 				if (supportedMethods == null)
 				{
 					knownMethodSupport.Add(clazz, supportedMethods = new MethodSupport(clazz));

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/FieldCacheSanityChecker.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/FieldCacheSanityChecker.cs?rev=1101624&r1=1101623&r2=1101624&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/FieldCacheSanityChecker.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/FieldCacheSanityChecker.cs
Tue May 10 20:08:34 2011
@@ -217,7 +217,7 @@ namespace Lucene.Net.Util
                 if (seen.ContainsKey(rf))
                     continue;
 
-                System.Collections.IList kids = GetAllDecendentReaderKeys(rf.readerKey);
+                List<object> kids = GetAllDecendentReaderKeys(rf.readerKey);
 				for (int i = 0; i < kids.Count; i++)
 				{
 					ReaderField kid = new ReaderField(kids[i], rf.fieldName);
@@ -280,9 +280,9 @@ namespace Lucene.Net.Util
 		/// the hierarchy of subReaders building up a list of the objects 
 		/// returned by obj.getFieldCacheKey()
 		/// </summary>
-		private System.Collections.IList GetAllDecendentReaderKeys(System.Object seed)
+		private List<object> GetAllDecendentReaderKeys(System.Object seed)
 		{
-			System.Collections.IList all = new System.Collections.ArrayList(17); // will grow as we
iter
+            List<object> all = new List<object>(17); // will grow as we iter
 			all.Add(seed);
 			for (int i = 0; i < all.Count; i++)
 			{
@@ -296,8 +296,9 @@ namespace Lucene.Net.Util
 					}
 				}
 			}
+            
 			// need to skip the first, because it was the seed
-			return (System.Collections.IList) ((System.Collections.ArrayList) all).GetRange(1, all.Count
- 1);
+            return all.GetRange(1, all.Count - 1); 
 		}
 		
 		/// <summary> Simple pair object for using "readerKey + fieldName" a Map key</summary>



Mime
View raw message