lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r880662 - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/ Lucene.Net/Index/ Lucene.Net/Store/ Test/Index/
Date Mon, 16 Nov 2009 08:31:35 GMT
Author: digy
Date: Mon Nov 16 08:31:22 2009
New Revision: 880662

URL: http://svn.apache.org/viewvc?rev=880662&view=rev
Log:
LUCENENET-253 TestIndexReaderCloneNorms.TestNormsRefCounting

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/CheckIndex.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DirectoryReader.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/FilterIndexReader.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexCommit.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/MultiReader.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/ParallelReader.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfo.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentReader.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SnapshotDeletionPolicy.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/IndexInput.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/IndexOutput.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReaderReopen.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestTransactionRollback.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/CheckIndex.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/CheckIndex.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/CheckIndex.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/CheckIndex.cs Mon Nov 16 08:31:22 2009
@@ -114,7 +114,7 @@
 			public bool partial;
 			
 			/// <summary>Holds the userData of the last commit in the index </summary>
-			public System.Collections.IDictionary userData;
+            public System.Collections.Generic.IDictionary<string, string> userData;
 			
 			/// <summary>Holds the status of each segment in the index.
 			/// See {@link #segmentInfos}.
@@ -185,7 +185,7 @@
 				/// debugging details that IndexWriter records into
 				/// each segment it creates 
 				/// </summary>
-				public System.Collections.IDictionary diagnostics;
+                public System.Collections.Generic.IDictionary<string, string> diagnostics;
 				
 				/// <summary>Status for testing of field norms (null if field norms could not be
tested). </summary>
 				public FieldNormStatus fieldNormStatus;
@@ -507,7 +507,7 @@
 					segInfoStat.numFiles = info.Files().Count;
 					Msg(System.String.Format(nf, "    size (MB)={0:f}", new System.Object[] { (info.SizeInBytes()
/ (1024.0 * 1024.0)) }));
 					segInfoStat.sizeMB = info.SizeInBytes() / (1024.0 * 1024.0);
-					System.Collections.IDictionary diagnostics = info.GetDiagnostics();
+                    System.Collections.Generic.IDictionary<string, string> diagnostics
= info.GetDiagnostics();
 					segInfoStat.diagnostics = diagnostics;
 					if (diagnostics.Count > 0)
 					{

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DirectoryReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/DirectoryReader.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DirectoryReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DirectoryReader.cs Mon Nov 16 08:31:22
2009
@@ -896,7 +896,7 @@
 		/// 
 		/// </summary>
 		/// <throws>  IOException if there is a low-level IO error </throws>
-		protected internal override void  DoCommit(System.Collections.IDictionary commitUserData)
+        protected internal override void DoCommit(System.Collections.Generic.IDictionary<string,
string> commitUserData)
 		{
 			if (hasChanges)
 			{
@@ -990,8 +990,8 @@
 				subReaders[i].RollbackCommit();
 			}
 		}
-		
-		public override System.Collections.IDictionary GetCommitUserData()
+
+        public override System.Collections.Generic.IDictionary<string, string> GetCommitUserData()
 		{
 			EnsureOpen();
 			return segmentInfos.GetUserData();
@@ -1148,7 +1148,7 @@
 			internal long generation;
 			internal long version;
 			internal bool isOptimized;
-			internal System.Collections.IDictionary userData;
+            internal System.Collections.Generic.IDictionary<string, string> userData;
 			
 			internal ReaderCommit(SegmentInfos infos, Directory dir)
 			{
@@ -1195,8 +1195,8 @@
 			{
 				return false;
 			}
-			
-			public override System.Collections.IDictionary GetUserData()
+
+            public override System.Collections.Generic.IDictionary<string, string>
GetUserData()
 			{
 				return userData;
 			}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/FilterIndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/FilterIndexReader.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/FilterIndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/FilterIndexReader.cs Mon Nov 16 08:31:22
2009
@@ -288,8 +288,8 @@
 		{
 			DoCommit(null);
 		}
-		
-		protected internal override void  DoCommit(System.Collections.IDictionary commitUserData)
+
+        protected internal override void DoCommit(System.Collections.Generic.IDictionary<string,
string> commitUserData)
 		{
 			in_Renamed.Commit(commitUserData);
 		}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexCommit.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexCommit.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexCommit.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexCommit.cs Mon Nov 16 08:31:22
2009
@@ -129,7 +129,7 @@
 		/// IndexWriter#Commit(Map)} for this commit.  Map is
 		/// String -> String. 
 		/// </summary>
-		public virtual System.Collections.IDictionary GetUserData()
+        public virtual System.Collections.Generic.IDictionary<string, string> GetUserData()
 		{
 			throw new System.NotSupportedException("This IndexCommit does not support this method.");
 		}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexFileDeleter.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs Mon Nov 16 08:31:22
2009
@@ -694,7 +694,7 @@
 			internal long version;
 			internal long generation;
 			internal bool isOptimized;
-			internal System.Collections.IDictionary userData;
+            internal System.Collections.Generic.IDictionary<string, string> userData;
 			
 			public CommitPoint(IndexFileDeleter enclosingInstance, System.Collections.ICollection
commitsToDelete, Directory directory, SegmentInfos segmentInfos)
 			{
@@ -741,8 +741,8 @@
 			{
 				return generation;
 			}
-			
-			public override System.Collections.IDictionary GetUserData()
+
+            public override System.Collections.Generic.IDictionary<string, string>
GetUserData()
 			{
 				return userData;
 			}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexReader.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs Mon Nov 16 08:31:22
2009
@@ -831,7 +831,7 @@
 		/// </summary>
 		/// <seealso cref="GetCommitUserData()">
 		/// </seealso>
-		public static System.Collections.IDictionary GetCommitUserData(Directory directory)
+        public static System.Collections.Generic.IDictionary<string, string> GetCommitUserData(Directory
directory)
 		{
 			return SegmentInfos.ReadCurrentUserData(directory);
 		}
@@ -851,7 +851,7 @@
 		/// </summary>
 		/// <seealso cref="GetCommitUserData(Directory)">
 		/// </seealso>
-		public virtual System.Collections.IDictionary GetCommitUserData()
+        public virtual System.Collections.Generic.IDictionary<string, string> GetCommitUserData()
 		{
 			throw new System.NotSupportedException("This reader does not support this method.");
 		}
@@ -1407,7 +1407,7 @@
 		/// IndexReader#getCommitUserData}.
 		/// </param>
 		/// <throws>  IOException </throws>
-		public void  Flush(System.Collections.IDictionary commitUserData)
+        public void Flush(System.Collections.Generic.IDictionary<string, string> commitUserData)
 		{
 			lock (this)
 			{
@@ -1440,7 +1440,7 @@
 		/// (transactional semantics).
 		/// </summary>
 		/// <throws>  IOException if there is a low-level IO error </throws>
-		protected internal void  Commit(System.Collections.IDictionary commitUserData)
+        protected internal void Commit(System.Collections.Generic.IDictionary<string,
string> commitUserData)
 		{
 			lock (this)
 			{
@@ -1461,7 +1461,7 @@
 		/// <summary>Implements commit.  NOTE: subclasses should override
 		/// this.  In 3.0 this will become an abstract method. 
 		/// </summary>
-		protected internal virtual void  DoCommit(System.Collections.IDictionary commitUserData)
+        protected internal virtual void DoCommit(System.Collections.Generic.IDictionary<string,
string> commitUserData)
 		{
 			// Default impl discards commitUserData; all Lucene
 			// subclasses override this (do not discard it).

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=880662&r1=880661&r2=880662&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 Mon Nov 16 08:31:22
2009
@@ -4670,12 +4670,12 @@
 		/// index to commit.  Therefore it's best to use this
 		/// feature only when autoCommit is false.
 		/// </param>
-		public void  PrepareCommit(System.Collections.IDictionary commitUserData)
+        public void PrepareCommit(System.Collections.Generic.IDictionary<string, string>
commitUserData)
 		{
 			PrepareCommit(commitUserData, false);
 		}
-		
-		private void  PrepareCommit(System.Collections.IDictionary commitUserData, bool internal_Renamed)
+
+        private void PrepareCommit(System.Collections.Generic.IDictionary<string, string>
commitUserData, bool internal_Renamed)
 		{
 			
 			if (hitOOM)
@@ -4748,7 +4748,7 @@
 		/// you should immediately close the writer.  See <a
 		/// href="#OOME">above</a> for details.</p>
 		/// </summary>
-		public void  Commit(System.Collections.IDictionary commitUserData)
+        public void Commit(System.Collections.Generic.IDictionary<string, string> commitUserData)
 		{
 			
 			EnsureOpen();
@@ -5574,9 +5574,9 @@
 				// ConcurrentMergePolicy we keep deterministic segment
 				// names.
 				merge.info = new SegmentInfo(NewSegmentName(), 0, directory, false, true, docStoreOffset,
docStoreSegment2, docStoreIsCompoundFile, false);
-				
-				
-				System.Collections.IDictionary details = new System.Collections.Hashtable();
+
+
+                System.Collections.Generic.IDictionary<string, string> details = new
System.Collections.Generic.Dictionary<string, string>();
 				details["optimize"] = merge.optimize + "";
 				details["mergeFactor"] = end + "";
 				details["mergeDocStores"] = mergeDocStores + "";
@@ -5594,10 +5594,10 @@
 		{
 			SetDiagnostics(info, source, null);
 		}
-		
-		private void  SetDiagnostics(SegmentInfo info, System.String source, System.Collections.IDictionary
details)
+
+        private void SetDiagnostics(SegmentInfo info, System.String source, System.Collections.Generic.IDictionary<string,
string> details)
 		{
-			System.Collections.IDictionary diagnostics = new System.Collections.Hashtable();
+            System.Collections.Generic.IDictionary<string, string> diagnostics = new
System.Collections.Generic.Dictionary<string,string>();
 			diagnostics["source"] = source;
 			diagnostics["lucene.version"] = Constants.LUCENE_VERSION;
 			diagnostics["os"] = Constants.OS_NAME + "";
@@ -5607,10 +5607,12 @@
 			diagnostics["java.vendor"] = Constants.JAVA_VENDOR + "";
 			if (details != null)
 			{
-				System.Collections.ArrayList keys = new System.Collections.ArrayList(details.Keys);
-				System.Collections.ArrayList values = new System.Collections.ArrayList(details.Values);
-				for (int i=0; i < keys.Count; i++)
-					diagnostics[keys[i]] = values[i];
+				//System.Collections.ArrayList keys = new System.Collections.ArrayList(details.Keys);
+				//System.Collections.ArrayList values = new System.Collections.ArrayList(details.Values);
+                foreach (string key in details.Keys)
+                {
+                    diagnostics[key] = details[key];
+                }
 			}
 			info.SetDiagnostics(diagnostics);
 		}
@@ -6240,7 +6242,7 @@
 		/// prepare a new segments_N file but do not fully commit
 		/// it. 
 		/// </summary>
-		private void  StartCommit(long sizeInBytes, System.Collections.IDictionary commitUserData)
+        private void StartCommit(long sizeInBytes, System.Collections.Generic.IDictionary<string,
string> commitUserData)
 		{
 			
 			System.Diagnostics.Debug.Assert(TestPoint("startStartCommit"));

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/MultiReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/MultiReader.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/MultiReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/MultiReader.cs Mon Nov 16 08:31:22
2009
@@ -440,8 +440,8 @@
 		{
 			DoCommit(null);
 		}
-		
-		protected internal override void  DoCommit(System.Collections.IDictionary commitUserData)
+
+        protected internal override void DoCommit(System.Collections.Generic.IDictionary<string,
string> commitUserData)
 		{
 			for (int i = 0; i < subReaders.Length; i++)
 				subReaders[i].Commit(commitUserData);

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/ParallelReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/ParallelReader.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/ParallelReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/ParallelReader.cs Mon Nov 16 08:31:22
2009
@@ -510,8 +510,8 @@
 		{
 			DoCommit(null);
 		}
-		
-		protected internal override void  DoCommit(System.Collections.IDictionary commitUserData)
+
+        protected internal override void DoCommit(System.Collections.Generic.IDictionary<string,
string> commitUserData)
 		{
 			for (int i = 0; i < readers.Count; i++)
 				((IndexReader) readers[i]).Commit(commitUserData);

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/SegmentInfo.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfo.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfo.cs Mon Nov 16 08:31:22
2009
@@ -85,8 +85,8 @@
 		// (if it's an older index)
 		
 		private bool hasProx; // True if this segment has any fields with omitTermFreqAndPositions==false
-		
-		private System.Collections.IDictionary diagnostics;
+
+        private System.Collections.Generic.IDictionary<string, string> diagnostics;
 		
 		public override System.String ToString()
 		{
@@ -152,13 +152,13 @@
 		}
 		
 		// must be Map<String, String>
-		internal void  SetDiagnostics(System.Collections.IDictionary diagnostics)
+        internal void SetDiagnostics(System.Collections.Generic.IDictionary<string, string>
diagnostics)
 		{
 			this.diagnostics = diagnostics;
 		}
 		
 		// returns Map<String, String>
-		public System.Collections.IDictionary GetDiagnostics()
+        public System.Collections.Generic.IDictionary<string, string> GetDiagnostics()
 		{
 			return diagnostics;
 		}
@@ -238,11 +238,11 @@
 				
 				if (format <= SegmentInfos.FORMAT_DIAGNOSTICS)
 				{
-					diagnostics = input.readStringStringMap();
+					diagnostics = input.ReadStringStringMap();
 				}
 				else
 				{
-					diagnostics = (System.Collections.IDictionary) new System.Collections.Hashtable();
+					diagnostics = new System.Collections.Generic.Dictionary<string,string>();
 				}
 			}
 			else
@@ -257,7 +257,7 @@
 				docStoreSegment = null;
 				delCount = - 1;
 				hasProx = true;
-				diagnostics = (System.Collections.IDictionary) new System.Collections.Hashtable();
+				diagnostics = new System.Collections.Generic.Dictionary<string,string>();
 			}
 		}
 		
@@ -370,10 +370,10 @@
 			si.hasSingleNormFile = hasSingleNormFile;
             if (this.diagnostics != null)
             {
-                si.diagnostics = new System.Collections.Hashtable();
-                foreach (object o in diagnostics)
+                si.diagnostics = new System.Collections.Generic.Dictionary<string, string>();
+                foreach (string o in diagnostics.Keys)
                 {
-                    si.diagnostics.Add(o,o);
+                    si.diagnostics.Add(o,diagnostics[o]);
                 }
             }
 			if (normGen != null)

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=880662&r1=880661&r2=880662&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 Mon Nov 16 08:31:22
2009
@@ -163,8 +163,8 @@
 		private long lastGeneration = 0; // generation of the "segments_N" file we last successfully
read
 		// or wrote; this is normally the same as generation except if
 		// there was an IOException that had interrupted a commit
-		
-		private System.Collections.IDictionary userData = (System.Collections.IDictionary) new
System.Collections.Hashtable(); // Opaque Map<String, String> that user can specify
during IndexWriter.commit
+
+        private System.Collections.Generic.IDictionary<string, string> userData = new
System.Collections.Generic.Dictionary<string, string>(); // Opaque Map<String, String>
that user can specify during IndexWriter.commit
 		
 		/// <summary> If non-null, information about loading segments_N files</summary>
 		/// <seealso cref="setInfoStream.">
@@ -348,21 +348,21 @@
 				{
 					if (format <= FORMAT_DIAGNOSTICS)
 					{
-						userData = input.readStringStringMap();
+						userData = input.ReadStringStringMap();
 					}
 					else if (0 != input.ReadByte())
 					{
-                        userData = new System.Collections.Hashtable();
+                        userData = new System.Collections.Generic.Dictionary<string,string>();
 						userData.Add("userData", input.ReadString());
 					}
 					else
 					{
-						userData = (System.Collections.IDictionary) new System.Collections.Hashtable();
+                        userData = new System.Collections.Generic.Dictionary<string, string>();
 					}
 				}
 				else
 				{
-					userData = (System.Collections.IDictionary) new System.Collections.Hashtable();
+                    userData = new System.Collections.Generic.Dictionary<string, string>();
 				}
 				
 				if (format <= FORMAT_CHECKSUM)
@@ -481,7 +481,7 @@
             sis.generation = this.generation;
             sis.lastGeneration = this.lastGeneration;
             // sis.pendingSegnOutput = this.pendingSegnOutput; // {{Aroush-2.9}} needed?
-            sis.userData = new System.Collections.Hashtable(userData);
+            sis.userData = new System.Collections.Generic.Dictionary<string, string>(userData);
             sis.version = this.version;
             return sis;
 		}
@@ -512,7 +512,7 @@
 		/// <summary> Returns userData from latest segments file</summary>
 		/// <throws>  CorruptIndexException if the index is corrupt </throws>
 		/// <throws>  IOException if there is a low-level IO error </throws>
-		public static System.Collections.IDictionary ReadCurrentUserData(Directory directory)
+        public static System.Collections.Generic.IDictionary<string, string> ReadCurrentUserData(Directory
directory)
 		{
 			SegmentInfos sis = new SegmentInfos();
 			sis.Read(directory);
@@ -1066,16 +1066,16 @@
 			}
 		}
 		
-		public System.Collections.IDictionary GetUserData()
+		public System.Collections.Generic.IDictionary<string,string> GetUserData()
 		{
 			return userData;
 		}
-		
-		internal void  SetUserData(System.Collections.IDictionary data)
+
+        internal void SetUserData(System.Collections.Generic.IDictionary<string, string>
data)
 		{
 			if (data == null)
 			{
-				userData = (System.Collections.IDictionary) new System.Collections.Hashtable();
+				userData = new System.Collections.Generic.Dictionary<string,string>();
 			}
 			else
 			{

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/SegmentReader.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentReader.cs Mon Nov 16 08:31:22
2009
@@ -1011,8 +1011,8 @@
 		{
 			DoCommit(null);
 		}
-		
-		protected internal override void  DoCommit(System.Collections.IDictionary commitUserData)
+
+        protected internal override void DoCommit(System.Collections.Generic.IDictionary<string,
string> commitUserData)
 		{
 			if (hasChanges)
 			{

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SnapshotDeletionPolicy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/SnapshotDeletionPolicy.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SnapshotDeletionPolicy.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SnapshotDeletionPolicy.cs Mon Nov 16
08:31:22 2009
@@ -161,7 +161,7 @@
 			{
 				return cp.GetGeneration();
 			}
-			public override System.Collections.IDictionary GetUserData()
+            public override System.Collections.Generic.IDictionary<string, string>
GetUserData()
 			{
 				return cp.GetUserData();
 			}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/IndexInput.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Store/IndexInput.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/IndexInput.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/IndexInput.cs Mon Nov 16 08:31:22 2009
@@ -267,9 +267,9 @@
 		}
 		
 		// returns Map<String, String>
-		public virtual System.Collections.IDictionary readStringStringMap()
+		public virtual System.Collections.Generic.IDictionary<string,string> ReadStringStringMap()
 		{
-			System.Collections.IDictionary map = new System.Collections.Hashtable();
+            System.Collections.Generic.Dictionary<string, string> map = new System.Collections.Generic.Dictionary<string,
string>();
 			int count = ReadInt();
 			for (int i = 0; i < count; i++)
 			{

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/IndexOutput.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Store/IndexOutput.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/IndexOutput.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/IndexOutput.cs Mon Nov 16 08:31:22
2009
@@ -253,7 +253,7 @@
 		
 		
 		// map must be Map<String, String>
-		public virtual void  WriteStringStringMap(System.Collections.IDictionary map)
+		public virtual void  WriteStringStringMap(System.Collections.Generic.IDictionary<string,string>
map)
 		{
 			if (map == null)
 			{
@@ -262,17 +262,11 @@
 			else
 			{
 				WriteInt(map.Count);
-				System.Collections.IEnumerator it = new System.Collections.Hashtable(map).GetEnumerator();
-				while (it.MoveNext())
-				{
-					System.Collections.DictionaryEntry entry = (System.Collections.DictionaryEntry) it.Current;
-                    if (entry.Key is System.Collections.DictionaryEntry)
-                    {
-                        entry = (System.Collections.DictionaryEntry)entry.Key;
-                    }
-					WriteString((System.String) entry.Key);
-					WriteString((System.String) entry.Value);
-				}
+                foreach (string key in map.Keys)
+                {
+                    WriteString(key);
+                    WriteString(map[key]);
+                }
 			}
 		}
 	}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/SupportClass.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs Mon Nov 16 08:31:22 2009
@@ -1547,6 +1547,17 @@
             return false;
         }
 
+
+        public static System.String CollectionToString(System.Collections.Generic.IDictionary<string,
string> c)
+        {
+            Hashtable t = new Hashtable();
+            foreach (string key in c.Keys)
+            {
+                t.Add(key, c[key]);
+            }
+            return CollectionToString(t);
+        }
+
         /// <summary>
         /// Converts the specified collection to its string representation.
         /// </summary>

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexReader.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs Mon Nov 16 08:31:22 2009
@@ -70,8 +70,8 @@
 		public virtual void  TestCommitUserData()
 		{
 			RAMDirectory d = new MockRAMDirectory();
-			
-			System.Collections.IDictionary commitUserData = new System.Collections.Hashtable();
+
+            System.Collections.Generic.IDictionary<string, string> commitUserData =
new System.Collections.Generic.Dictionary<string,string>();
 			commitUserData["foo"] = "fighters";
 			
 			// set up writer

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReaderReopen.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexReaderReopen.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReaderReopen.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReaderReopen.cs Mon Nov 16 08:31:22
2009
@@ -1647,14 +1647,14 @@
 				Document doc = new Document();
 				doc.Add(new Field("id", "" + i, Field.Store.NO, Field.Index.NOT_ANALYZED));
 				writer.AddDocument(doc);
-				System.Collections.IDictionary data = new System.Collections.Hashtable();
+                System.Collections.Generic.IDictionary<string, string> data = new System.Collections.Generic.Dictionary<string,
string>();
 				data["index"] = i + "";
 				writer.Commit(data);
 			}
 			for (int i = 0; i < 4; i++)
 			{
 				writer.DeleteDocuments(new Term("id", "" + i));
-				System.Collections.IDictionary data = new System.Collections.Hashtable();
+                System.Collections.Generic.IDictionary<string, string> data = new System.Collections.Generic.Dictionary<string,string>();
 				data["index"] = (4 + i) + "";
 				writer.Commit(data);
 			}
@@ -1681,8 +1681,8 @@
 				{
 					// expected
 				}
-				
-				System.Collections.IDictionary s = commit.GetUserData();
+
+                System.Collections.Generic.IDictionary<string, string> s = commit.GetUserData();
 				int v;
 				if (s.Count == 0)
 				{

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexWriter.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs Mon Nov 16 08:31:22 2009
@@ -5033,7 +5033,7 @@
 			w.SetMaxBufferedDocs(2);
 			for (int j = 0; j < 17; j++)
 				AddDoc(w);
-			System.Collections.IDictionary data = new System.Collections.Hashtable();
+            System.Collections.Generic.IDictionary<string, string> data = new System.Collections.Generic.Dictionary<string,string>();
 			data["label"] = "test1";
 			w.Commit(data);
 			w.Close();

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestTransactionRollback.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestTransactionRollback.cs?rev=880662&r1=880661&r2=880662&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestTransactionRollback.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestTransactionRollback.cs Mon Nov 16 08:31:22
2009
@@ -55,7 +55,7 @@
 			for (System.Collections.IEnumerator iterator = commits.GetEnumerator(); iterator.MoveNext();
)
 			{
 				IndexCommit commit = (IndexCommit) iterator.Current;
-				System.Collections.IDictionary ud = commit.GetUserData();
+                System.Collections.Generic.IDictionary<string, string> ud = commit.GetUserData();
 				if (ud.Count > 0)
 					if (((System.String) ud["index"]).EndsWith(ids))
 						last = commit;
@@ -65,7 +65,7 @@
 				throw new System.SystemException("Couldn't find commit point " + id);
 			
 			IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(), new RollbackDeletionPolicy(this,
id), MaxFieldLength.UNLIMITED, last);
-			System.Collections.IDictionary data = new System.Collections.Hashtable();
+            System.Collections.Generic.IDictionary<string, string> data = new System.Collections.Generic.Dictionary<string,
string>();
 			data["index"] = "Rolled back to 1-" + id;
 			w.Commit(data);
 			w.Close();
@@ -142,7 +142,7 @@
 				
 				if (currentRecordId % 10 == 0)
 				{
-					System.Collections.IDictionary data = new System.Collections.Hashtable();
+                    System.Collections.Generic.IDictionary<string, string> data = new
System.Collections.Generic.Dictionary<string,string>();
 					data["index"] = "records 1-" + currentRecordId;
 					w.Commit(data);
 				}
@@ -184,7 +184,7 @@
 				for (System.Collections.IEnumerator iterator = commits.GetEnumerator(); iterator.MoveNext();
)
 				{
 					IndexCommit commit = (IndexCommit) iterator.Current;
-					System.Collections.IDictionary userData = commit.GetUserData();
+                    System.Collections.Generic.IDictionary<string, string> userData
= commit.GetUserData();
 					if (userData.Count > 0)
 					{
 						// Label for a commit point is "Records 1-30"



Mime
View raw message