You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2009/11/15 11:49:33 UTC
svn commit: r836347 - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/
Lucene.Net/Index/ Lucene.Net/Store/ Test/ Test/Index/
Author: digy
Date: Sun Nov 15 10:49:32 2009
New Revision: 836347
URL: http://svn.apache.org/viewvc?rev=836347&view=rev
Log:
LUCENENET-247 Big4.patch
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/DocumentsWriter.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/FieldInfos.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/IndexCommitPoint.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/SegmentMerger.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/IndexOutput.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
incubator/lucene.net/trunk/C#/src/Test/Index/TestCompoundFile.cs
incubator/lucene.net/trunk/C#/src/Test/Index/TestDoc.cs
incubator/lucene.net/trunk/C#/src/Test/Index/TestFieldsReader.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/TestParallelReader.cs
incubator/lucene.net/trunk/C#/src/Test/Index/TestSegmentMerger.cs
incubator/lucene.net/trunk/C#/src/Test/Index/TestSegmentReader.cs
incubator/lucene.net/trunk/C#/src/Test/TestSnapshotDeletionPolicy.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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -577,7 +577,7 @@
{
infoStream.Write(" test: fields..............");
}
- System.Collections.ICollection fieldNames = reader.GetFieldNames(IndexReader.FieldOption.ALL);
+ System.Collections.Generic.ICollection<string> fieldNames = reader.GetFieldNames(IndexReader.FieldOption.ALL);
Msg("OK [" + fieldNames.Count + " fields]");
segInfoStat.numFields = fieldNames.Count;
@@ -649,7 +649,7 @@
}
/// <summary> Test field norms.</summary>
- private Status.FieldNormStatus TestFieldNorms(System.Collections.ICollection fieldNames, SegmentReader reader)
+ private Status.FieldNormStatus TestFieldNorms(System.Collections.Generic.ICollection<string> fieldNames, SegmentReader reader)
{
Status.FieldNormStatus status = new Status.FieldNormStatus();
@@ -664,7 +664,7 @@
byte[] b = new byte[reader.MaxDoc()];
while (it.MoveNext())
{
- System.String fieldName = (System.String) ((System.Collections.DictionaryEntry) it.Current).Value;
+ System.String fieldName = (System.String) it.Current;
reader.Norms(fieldName, b, 0);
++status.totFields;
}
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -90,7 +90,7 @@
internal IndexWriter writer;
private IndexDeletionPolicy deletionPolicy;
- private System.Collections.Hashtable synced = new System.Collections.Hashtable();
+ private System.Collections.Generic.Dictionary<string, string> synced = new System.Collections.Generic.Dictionary<string, string>();
private Lock writeLock;
private SegmentInfos segmentInfos;
private bool stale;
@@ -365,8 +365,13 @@
for (int i = 0; i < subReaders.Length; i++)
{
- int oldReaderIndex = (System.Int32) segmentReaders[subReaders[i].GetSegmentName()];
bool exist = segmentReaders.Contains(subReaders[i].GetSegmentName());
+ int oldReaderIndex = -1;
+ if (exist)
+ {
+ oldReaderIndex = (System.Int32)segmentReaders[subReaders[i].GetSegmentName()];
+ }
+
// this SegmentReader was not re-opened, we can copy all of its norms
if (exist && (oldReaders[oldReaderIndex] == subReaders[i] || oldReaders[oldReaderIndex].norms[field] == subReaders[i].norms[field]))
@@ -909,19 +914,17 @@
{
for (int i = 0; i < subReaders.Length; i++)
subReaders[i].Commit();
-
- // Sync all files we just wrote
- System.Collections.IEnumerator it = segmentInfos.Files(directory, false).GetEnumerator();
- while (it.MoveNext())
- {
- System.String fileName = (string)((System.Collections.DictionaryEntry) it.Current).Value;
- if (!synced.Contains(fileName))
- {
- System.Diagnostics.Debug.Assert(directory.FileExists(fileName));
+
+ // Sync all files we just wrote
+ foreach(string fileName in segmentInfos.Files(directory, false))
+ {
+ if(!synced.ContainsKey(fileName))
+ {
+ System.Diagnostics.Debug.Assert(directory.FileExists(fileName));
directory.Sync(fileName);
- SupportClass.CollectionsHelper.AddIfNotContains(synced, fileName);
- }
- }
+ synced.Add(fileName,fileName);
+ }
+ }
segmentInfos.Commit(directory);
success = true;
@@ -1033,24 +1036,24 @@
throw ioe;
}
}
-
- public override System.Collections.ICollection GetFieldNames(IndexReader.FieldOption fieldNames)
+
+ public override System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption fieldNames)
{
EnsureOpen();
return GetFieldNames(fieldNames, this.subReaders);
}
-
- internal static System.Collections.ICollection GetFieldNames(IndexReader.FieldOption fieldNames, IndexReader[] subReaders)
+
+ internal static System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption fieldNames, IndexReader[] subReaders)
{
// maintain a unique set of field names
- System.Collections.Hashtable fieldSet = new System.Collections.Hashtable();
+ System.Collections.Generic.Dictionary<string,string> fieldSet = new System.Collections.Generic.Dictionary<string,string>();
for (int i = 0; i < subReaders.Length; i++)
{
IndexReader reader = subReaders[i];
- System.Collections.ICollection names = reader.GetFieldNames(fieldNames);
+ System.Collections.Generic.ICollection<string> names = reader.GetFieldNames(fieldNames);
SupportClass.CollectionsHelper.AddAllIfNotContains(fieldSet, names);
}
- return fieldSet;
+ return fieldSet.Keys;
}
public override IndexReader[] GetSequentialSubReaders()
@@ -1140,7 +1143,7 @@
private sealed class ReaderCommit:IndexCommit
{
private System.String segmentsFileName;
- internal System.Collections.ICollection files;
+ internal System.Collections.Generic.ICollection<string> files;
internal Directory dir;
internal long generation;
internal long version;
@@ -1152,7 +1155,7 @@
segmentsFileName = infos.GetCurrentSegmentFileName();
this.dir = dir;
userData = infos.GetUserData();
- files = System.Collections.ArrayList.ReadOnly(new System.Collections.ArrayList(infos.Files(dir, true)));
+ files = infos.Files(dir, true);
version = infos.GetVersion();
generation = infos.GetGeneration();
isOptimized = infos.Count == 1 && !infos.Info(0).HasDeletions();
@@ -1167,8 +1170,8 @@
{
return segmentsFileName;
}
-
- public override System.Collections.ICollection GetFileNames()
+
+ public override System.Collections.Generic.ICollection<string> GetFileNames()
{
return files;
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DocumentsWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/DocumentsWriter.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DocumentsWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DocumentsWriter.cs Sun Nov 15 10:49:32 2009
@@ -473,11 +473,11 @@
}
}
- private System.Collections.ICollection abortedFiles; // List of files that were written before last abort()
+ private System.Collections.Generic.ICollection<string> abortedFiles; // List of files that were written before last abort()
private SegmentWriteState flushState;
-
- internal System.Collections.ICollection AbortedFiles()
+
+ internal System.Collections.Generic.ICollection<string> AbortedFiles()
{
return abortedFiles;
}
@@ -487,26 +487,30 @@
if (infoStream != null)
writer.Message("DW: " + message);
}
-
- internal System.Collections.IList openFiles = new System.Collections.ArrayList();
- internal System.Collections.IList closedFiles = new System.Collections.ArrayList();
+
+ internal System.Collections.Generic.IList<string> openFiles = new System.Collections.Generic.List<string>();
+ internal System.Collections.Generic.IList<string> closedFiles = new System.Collections.Generic.List<string>();
/* Returns Collection of files in use by this instance,
* including any flushed segments. */
- internal System.Collections.IList OpenFiles()
+ internal System.Collections.Generic.IList<string> OpenFiles()
{
lock (this)
{
- return (System.Collections.IList) ((System.Collections.ArrayList) openFiles).Clone();
+ string[] tmp = new string[openFiles.Count];
+ openFiles.CopyTo(tmp, 0);
+ return tmp;
}
}
- internal System.Collections.IList ClosedFiles()
+ internal System.Collections.Generic.IList<string> ClosedFiles()
{
- lock (this)
- {
- return (System.Collections.IList) ((System.Collections.ArrayList) closedFiles).Clone();
- }
+ lock (this)
+ {
+ string[] tmp = new string[closedFiles.Count];
+ closedFiles.CopyTo(tmp, 0);
+ return tmp;
+ }
}
internal void AddOpenFile(System.String name)
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/FieldInfos.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/FieldInfos.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/FieldInfos.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/FieldInfos.cs Sun Nov 15 10:49:32 2009
@@ -189,7 +189,7 @@
/// </param>
/// <seealso cref="Add(String, boolean)">
/// </seealso>
- public void Add(System.Collections.ICollection names, bool isIndexed)
+ public void Add(System.Collections.Generic.ICollection<string> names, bool isIndexed)
{
lock (this)
{
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -298,9 +298,9 @@
{
in_Renamed.Close();
}
-
-
- public override System.Collections.ICollection GetFieldNames(IndexReader.FieldOption fieldNames)
+
+
+ public override System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption fieldNames)
{
EnsureOpen();
return in_Renamed.GetFieldNames(fieldNames);
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -49,7 +49,7 @@
public abstract System.String GetSegmentsFileName();
/// <summary> Returns all index files referenced by this commit point.</summary>
- public abstract System.Collections.ICollection GetFileNames();
+ public abstract System.Collections.Generic.ICollection<string> GetFileNames();
/// <summary> Returns the {@link Directory} for the index.</summary>
public abstract Directory GetDirectory();
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexCommitPoint.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexCommitPoint.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexCommitPoint.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexCommitPoint.cs Sun Nov 15 10:49:32 2009
@@ -32,7 +32,7 @@
System.String GetSegmentsFileName();
/// <summary> Returns all index files referenced by this commit point.</summary>
- System.Collections.ICollection GetFileNames();
+ System.Collections.Generic.ICollection<string> GetFileNames();
/// <summary> Delete this commit point.
/// <p>
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -88,7 +88,7 @@
/* Holds files we had incref'd from the previous
* non-commit checkpoint: */
- private System.Collections.IList lastFiles = new System.Collections.ArrayList();
+ private System.Collections.Generic.IList<string> lastFiles = new System.Collections.Generic.List<string>();
/* Commits that the IndexDeletionPolicy have decided to delete: */
private System.Collections.ArrayList commitsToDelete = new System.Collections.ArrayList();
@@ -286,10 +286,10 @@
{
Message("deleteCommits: now decRef commit \"" + commit.GetSegmentsFileName() + "\"");
}
- System.Collections.IEnumerator it = commit.files.GetEnumerator();
+ System.Collections.Generic.IEnumerator<string> it = commit.files.GetEnumerator();
while (it.MoveNext())
{
- DecRef((System.String) ((System.Collections.DictionaryEntry) it.Current).Key);
+ DecRef(it.Current);
}
}
commitsToDelete.Clear();
@@ -371,7 +371,7 @@
if (size > 0)
{
for (int i = 0; i < size; i++)
- DecRef((System.Collections.ICollection) lastFiles[i]);
+ DecRef(lastFiles[i]);
lastFiles.Clear();
}
@@ -444,7 +444,7 @@
else
{
- System.Collections.IList docWriterFiles;
+ System.Collections.Generic.IList<string> docWriterFiles;
if (docWriter != null)
{
docWriterFiles = docWriter.OpenFiles();
@@ -462,15 +462,23 @@
if (size > 0)
{
for (int i = 0; i < size; i++)
- DecRef((System.Collections.ICollection) lastFiles[i]);
+ DecRef(lastFiles[i]);
lastFiles.Clear();
}
// Save files so we can decr on next checkpoint/commit:
- lastFiles.Add(segmentInfos.Files(directory, false));
+ foreach (string fname in segmentInfos.Files(directory, false))
+ {
+ lastFiles.Add(fname);
+ }
- if (docWriterFiles != null)
- lastFiles.Add(docWriterFiles);
+ if (docWriterFiles != null)
+ {
+ foreach (string fname in docWriterFiles)
+ {
+ lastFiles.Add(fname);
+ }
+ }
}
}
@@ -478,14 +486,14 @@
{
// If this is a commit point, also incRef the
// segments_N file:
- System.Collections.IEnumerator it = segmentInfos.Files(directory, isCommit).GetEnumerator();
+ System.Collections.Generic.IEnumerator<string> it = segmentInfos.Files(directory, isCommit).GetEnumerator();
while (it.MoveNext())
{
- IncRef((System.String) ((System.Collections.DictionaryEntry) it.Current).Key);
+ IncRef(it.Current);
}
}
- internal void IncRef(System.Collections.IList files)
+ internal void IncRef(System.Collections.Generic.IList<string> files)
{
int size = files.Count;
for (int i = 0; i < size; i++)
@@ -504,7 +512,7 @@
rc.IncRef();
}
- internal void DecRef(System.Collections.ICollection files)
+ internal void DecRef(System.Collections.Generic.ICollection<string> files)
{
if (files is System.Collections.Hashtable)
{
@@ -542,10 +550,10 @@
internal void DecRef(SegmentInfos segmentInfos)
{
- System.Collections.IEnumerator it = segmentInfos.Files(directory, false).GetEnumerator();
+ System.Collections.Generic.IEnumerator<string> it = segmentInfos.Files(directory, false).GetEnumerator();
while (it.MoveNext())
{
- DecRef((System.String)((System.Collections.DictionaryEntry) it.Current).Key);
+ DecRef(it.Current);
}
}
@@ -574,7 +582,7 @@
/// <summary>Deletes the specified files, but only if they are new
/// (have not yet been incref'd).
/// </summary>
- internal void DeleteNewFiles(System.Collections.ICollection files)
+ internal void DeleteNewFiles(System.Collections.Generic.ICollection<string> files)
{
System.Collections.IEnumerator it = files.GetEnumerator();
while (it.MoveNext())
@@ -678,7 +686,7 @@
}
internal long gen;
- internal System.Collections.ICollection files;
+ internal System.Collections.Generic.ICollection<string> files;
internal System.String segmentsFileName;
internal bool deleted;
internal Directory directory;
@@ -697,7 +705,7 @@
segmentsFileName = segmentInfos.GetCurrentSegmentFileName();
version = segmentInfos.GetVersion();
generation = segmentInfos.GetGeneration();
- files = System.Collections.ArrayList.ReadOnly(new System.Collections.ArrayList(segmentInfos.Files(directory, true)));
+ files = segmentInfos.Files(directory, true);
gen = segmentInfos.GetGeneration();
isOptimized = segmentInfos.Count == 1 && !segmentInfos.Info(0).HasDeletions();
@@ -713,8 +721,8 @@
{
return segmentsFileName;
}
-
- public override System.Collections.ICollection GetFileNames()
+
+ public override System.Collections.Generic.ICollection<string> GetFileNames()
{
return files;
}
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -1015,7 +1015,9 @@
public static bool IndexExists(System.IO.FileInfo directory)
{
- return SegmentInfos.GetCurrentSegmentGeneration(System.IO.Directory.GetFileSystemEntries(directory.FullName)) != - 1;
+ System.String[] list = null;
+ if (System.IO.Directory.Exists(directory.FullName)) list = System.IO.Directory.GetFileSystemEntries(directory.FullName);
+ return SegmentInfos.GetCurrentSegmentGeneration(list) != - 1;
}
/// <summary> Returns <code>true</code> if an index exists at the specified directory.
@@ -1496,7 +1498,7 @@
/// </returns>
/// <seealso cref="IndexReader.FieldOption">
/// </seealso>
- public abstract System.Collections.ICollection GetFieldNames(FieldOption fldOption);
+ public abstract System.Collections.Generic.ICollection<string> GetFieldNames(FieldOption fldOption);
/// <summary> Returns <code>true</code> iff the index in the named directory is
/// currently locked.
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=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs Sun Nov 15 10:49:32 2009
@@ -2832,7 +2832,7 @@
// never incref'd, then we clean them up here
if (docWriter != null)
{
- System.Collections.ICollection files = docWriter.AbortedFiles();
+ System.Collections.Generic.ICollection<string> files = docWriter.AbortedFiles();
if (files != null)
deleter.DeleteNewFiles(files);
}
@@ -3010,7 +3010,7 @@
{
// If docWriter has some aborted files that were
// never incref'd, then we clean them up here
- System.Collections.ICollection files = docWriter.AbortedFiles();
+ System.Collections.Generic.ICollection<string> files = docWriter.AbortedFiles();
if (files != null)
deleter.DeleteNewFiles(files);
}
@@ -4523,7 +4523,7 @@
if (mergePolicy is LogMergePolicy && GetUseCompoundFile())
{
- System.Collections.IList files = null;
+ System.Collections.Generic.IList<string> files = null;
lock (this)
{
@@ -6097,7 +6097,7 @@
}
// Files that have been sync'd already
- private System.Collections.Hashtable synced = new System.Collections.Hashtable();
+ private System.Collections.Generic.Dictionary<string, string> synced = new System.Collections.Generic.Dictionary<string, string>();
// Files that are now being sync'd
private System.Collections.Hashtable syncing = new System.Collections.Hashtable();
@@ -6106,7 +6106,7 @@
{
lock (synced)
{
- if (!synced.Contains(fileName))
+ if (!synced.ContainsKey(fileName))
{
if (!syncing.Contains(fileName))
{
@@ -6145,7 +6145,7 @@
while (it.MoveNext())
{
System.String fileName = (System.String) it.Current;
- while (!synced.Contains(fileName))
+ while (!synced.ContainsKey(fileName))
{
if (!syncing.Contains(fileName))
// There was an error because a file that was
@@ -6313,10 +6313,10 @@
deleter.IncRef(toSync, false);
myChangeCount = changeCount;
- System.Collections.IEnumerator it = toSync.Files(directory, false).GetEnumerator();
+ System.Collections.Generic.IEnumerator<string> it = toSync.Files(directory, false).GetEnumerator();
while (it.MoveNext())
{
- System.String fileName = (System.String) ((System.Collections.DictionaryEntry) it.Current).Key;
+ System.String fileName = it.Current;
System.Diagnostics.Debug.Assert(directory.FileExists(fileName), "file " + fileName + " does not exist");
}
}
@@ -6339,10 +6339,10 @@
System.Collections.Generic.ICollection<System.String> pending = new System.Collections.Generic.List<System.String>();
- System.Collections.IEnumerator it = toSync.Files(directory, false).GetEnumerator();
+ System.Collections.Generic.IEnumerator<string> it = toSync.Files(directory, false).GetEnumerator();
while (it.MoveNext())
{
- System.String fileName = (System.String) ((System.Collections.DictionaryEntry) it.Current).Key;
+ System.String fileName = it.Current;
if (StartSync(fileName, pending))
{
bool success = false;
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -464,8 +464,8 @@
}
}
}
-
- public override System.Collections.ICollection GetFieldNames(IndexReader.FieldOption fieldNames)
+
+ public override System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption fieldNames)
{
EnsureOpen();
return DirectoryReader.GetFieldNames(fieldNames, this.subReaders);
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -109,7 +109,7 @@
if (reader.NumDocs() != numDocs)
throw new System.ArgumentException("All readers must have same numDocs: " + numDocs + "!=" + reader.NumDocs());
- System.Collections.ICollection fields = reader.GetFieldNames(IndexReader.FieldOption.ALL);
+ System.Collections.Generic.ICollection<string> fields = reader.GetFieldNames(IndexReader.FieldOption.ALL);
readerToFields[reader] = fields;
System.Collections.IEnumerator i = fields.GetEnumerator();
while (i.MoveNext())
@@ -534,16 +534,16 @@
}
}
}
-
- public override System.Collections.ICollection GetFieldNames(IndexReader.FieldOption fieldNames)
+
+ public override System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption fieldNames)
{
EnsureOpen();
- System.Collections.Hashtable fieldSet = new System.Collections.Hashtable();
+ System.Collections.Generic.List<string> fieldSet = new System.Collections.Generic.List<string>();
for (int i = 0; i < readers.Count; i++)
{
IndexReader reader = ((IndexReader) readers[i]);
- System.Collections.ICollection names = reader.GetFieldNames(fieldNames);
- SupportClass.CollectionsHelper.AddAll(fieldSet, names);
+ System.Collections.Generic.ICollection<string> names = reader.GetFieldNames(fieldNames);
+ fieldSet.AddRange(names);
}
return fieldSet;
}
@@ -623,6 +623,7 @@
}
fieldIterator = newList.Keys.GetEnumerator();
+ fieldIterator.MoveNext();
System.Object generatedAux = fieldIterator.Current; // Skip field to get next one
}
while (fieldIterator.MoveNext())
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -70,7 +70,7 @@
// and true for newly created merged segments (both
// compound and non compound).
- private System.Collections.IList files; // cached list of files that this segment uses
+ private System.Collections.Generic.IList<string> files; // cached list of files that this segment uses
// in the Directory
internal long sizeInBytes = - 1; // total byte size of all of our files (computed on demand)
@@ -294,7 +294,7 @@
{
if (sizeInBytes == - 1)
{
- System.Collections.IList files = Files();
+ System.Collections.Generic.IList<string> files = Files();
int size = files.Count;
sizeInBytes = 0;
for (int i = 0; i < size; i++)
@@ -368,7 +368,14 @@
si.hasProx = hasProx;
si.preLockless = preLockless;
si.hasSingleNormFile = hasSingleNormFile;
- si.diagnostics = new System.Collections.Hashtable(diagnostics);
+ if (this.diagnostics != null)
+ {
+ si.diagnostics = new System.Collections.Hashtable();
+ foreach (object o in diagnostics)
+ {
+ si.diagnostics.Add(o,o);
+ }
+ }
if (normGen != null)
{
si.normGen = new long[normGen.Length];
@@ -377,6 +384,15 @@
si.docStoreOffset = docStoreOffset;
si.docStoreSegment = docStoreSegment;
si.docStoreIsCompoundFile = docStoreIsCompoundFile;
+ if (this.files != null)
+ {
+ si.files = new System.Collections.Generic.List<string>();
+ foreach (string file in files)
+ {
+ si.files.Add(file);
+ }
+ }
+
return si;
}
@@ -674,7 +690,7 @@
return hasProx;
}
- private void AddIfExists(System.Collections.IList files, System.String fileName)
+ private void AddIfExists(System.Collections.Generic.IList<string> files, System.String fileName)
{
if (dir.FileExists(fileName))
files.Add(fileName);
@@ -686,7 +702,7 @@
* modify it.
*/
- public System.Collections.IList Files()
+ public System.Collections.Generic.IList<string> Files()
{
if (files != null)
@@ -694,8 +710,8 @@
// Already cached:
return files;
}
-
- files = new System.Collections.ArrayList();
+
+ files = new System.Collections.Generic.List<string>();
bool useCompoundFile = GetUseCompoundFile();
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=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs Sun Nov 15 10:49:32 2009
@@ -473,9 +473,9 @@
public override System.Object Clone()
{
SegmentInfos sis = new SegmentInfos();
- for (int i = 0; i < base.Count; i++)
+ for (int i = 0; i < this.Count; i++)
{
- sis.Add(((SegmentInfo) base[i]).Clone());
+ sis.Add(((SegmentInfo) this[i]).Clone());
}
sis.counter = this.counter;
sis.generation = this.generation;
@@ -943,12 +943,13 @@
/// The returned collection is recomputed on each
/// invocation.
/// </summary>
- public System.Collections.ICollection Files(Directory dir, bool includeSegmentsFile)
+ public System.Collections.Generic.ICollection<string> Files(Directory dir, bool includeSegmentsFile)
{
- System.Collections.Hashtable files = new System.Collections.Hashtable();
+ System.Collections.Generic.Dictionary<string, string> files = new System.Collections.Generic.Dictionary<string, string>();
if (includeSegmentsFile)
{
- SupportClass.CollectionsHelper.AddIfNotContains(files, GetCurrentSegmentFileName());
+ string tmp = GetCurrentSegmentFileName();
+ files.Add(tmp, tmp);
}
int size = Count;
for (int i = 0; i < size; i++)
@@ -959,7 +960,7 @@
SupportClass.CollectionsHelper.AddAllIfNotContains(files, Info(i).Files());
}
}
- return files;
+ return files.Keys;
}
internal void FinishCommit(Directory dir)
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentMerger.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/SegmentMerger.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentMerger.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentMerger.cs Sun Nov 15 10:49:32 2009
@@ -304,8 +304,8 @@
return files;
}
-
- private void AddIndexed(IndexReader reader, FieldInfos fInfos, System.Collections.ICollection names, bool storeTermVectors, bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool storePayloads, bool omitTFAndPositions)
+
+ private void AddIndexed(IndexReader reader, FieldInfos fInfos, System.Collections.Generic.ICollection<string> names, bool storeTermVectors, bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool storePayloads, bool omitTFAndPositions)
{
System.Collections.IEnumerator i = names.GetEnumerator();
while (i.MoveNext())
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -1147,9 +1147,9 @@
}
}
- internal virtual System.Collections.IList Files()
+ internal virtual System.Collections.Generic.IList<string> Files()
{
- return new System.Collections.ArrayList(si.Files());
+ return si.Files();
}
public override TermEnum Terms()
@@ -1234,11 +1234,11 @@
/// <seealso cref="IndexReader.GetFieldNames(IndexReader.FieldOption fldOption)">
/// </seealso>
- public override System.Collections.ICollection GetFieldNames(IndexReader.FieldOption fieldOption)
+ public override System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption fieldOption)
{
EnsureOpen();
- System.Collections.Hashtable fieldSet = new System.Collections.Hashtable();
+ System.Collections.Generic.IDictionary<string, string> fieldSet = new System.Collections.Generic.Dictionary<string, string>();
for (int i = 0; i < core.fieldInfos.Size(); i++)
{
FieldInfo fi = core.fieldInfos.FieldInfo(i);
@@ -1287,7 +1287,7 @@
fieldSet[fi.name] = fi.name;
}
}
- return fieldSet;
+ return fieldSet.Keys;
}
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -131,7 +131,7 @@
{
return cp.GetSegmentsFileName();
}
- public override System.Collections.ICollection GetFileNames()
+ public override System.Collections.Generic.ICollection<string> GetFileNames()
{
return cp.GetFileNames();
}
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=836347&r1=836346&r2=836347&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 Sun Nov 15 10:49:32 2009
@@ -266,6 +266,10 @@
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);
}
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=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs Sun Nov 15 10:49:32 2009
@@ -1511,6 +1511,31 @@
}
}
+ public static void AddAllIfNotContains(System.Collections.Generic.IDictionary<string,string> hashtable, System.Collections.Generic.ICollection<string> items)
+ {
+ foreach (string s in items)
+ {
+ if (hashtable.ContainsKey(s) == false)
+ {
+ hashtable.Add(s, s);
+ }
+ }
+ }
+
+ public static void AddAll(System.Collections.Generic.IDictionary<string, string> hashtable, System.Collections.Generic.ICollection<string> items)
+ {
+ foreach (string s in items)
+ {
+ hashtable.Add(s, s);
+ }
+ }
+
+ public static bool Contains(System.Collections.Generic.ICollection<string> col, string item)
+ {
+ foreach (string s in col) if (s == item) return true;
+ return false;
+ }
+
public static bool Contains(System.Collections.ICollection col, System.Object item)
{
System.Collections.IEnumerator iter = col.GetEnumerator();
Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestCompoundFile.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestCompoundFile.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestCompoundFile.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestCompoundFile.cs Sun Nov 15 10:49:32 2009
@@ -348,7 +348,7 @@
b = in_Renamed.ReadByte();
Assert.Fail("expected readByte() to throw exception");
}
- catch (System.IO.IOException e)
+ catch (System.Exception e)
{
// expected exception
}
Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestDoc.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestDoc.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestDoc.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestDoc.cs Sun Nov 15 10:49:32 2009
@@ -116,8 +116,6 @@
{
pw.Close();
}
- if (fw != null)
- fw.Close();
}
}
Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestFieldsReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestFieldsReader.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestFieldsReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestFieldsReader.cs Sun Nov 15 10:49:32 2009
@@ -93,6 +93,14 @@
writer.AddDocument(testDoc);
writer.Close();
}
+
+ [TearDown]
+ public void TearDown()
+ {
+ fieldInfos = null;
+ testDoc = new Document();
+ dir = new RAMDirectory();
+ }
[Test]
public virtual void Test()
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=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs Sun Nov 15 10:49:32 2009
@@ -155,7 +155,7 @@
writer.Close();
// set up reader
IndexReader reader = IndexReader.Open(d);
- System.Collections.ICollection fieldNames = reader.GetFieldNames(IndexReader.FieldOption.ALL);
+ System.Collections.Generic.ICollection<string> fieldNames = reader.GetFieldNames(IndexReader.FieldOption.ALL);
Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "keyword"));
Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "text"));
Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unindexed"));
@@ -265,10 +265,10 @@
System.Collections.IDictionary map = mapper.GetFieldToTerms();
Assert.IsTrue(map != null, "map is null and it shouldn't be");
Assert.IsTrue(map.Count == 4, "map Size: " + map.Count + " is not: " + 4);
- System.Collections.Hashtable set_Renamed = (System.Collections.Hashtable) map["termvector"];
+ System.Collections.Generic.SortedDictionary<object, object> set_Renamed = (System.Collections.Generic.SortedDictionary<object, object>)map["termvector"];
for (System.Collections.IEnumerator iterator = set_Renamed.GetEnumerator(); iterator.MoveNext(); )
{
- TermVectorEntry entry = (TermVectorEntry) iterator.Current;
+ TermVectorEntry entry = (TermVectorEntry)((System.Collections.Generic.KeyValuePair<object, object>)iterator.Current).Key;
Assert.IsTrue(entry != null, "entry is null and it shouldn't be");
System.Console.Out.WriteLine("Entry: " + entry);
}
@@ -1541,18 +1541,22 @@
Assert.AreEqual(index1.IsOptimized(), index2.IsOptimized(), "Only one index is optimized.");
// check field names
- System.Collections.ICollection fields1 = index1.GetFieldNames(FieldOption.ALL);
- System.Collections.ICollection fields2 = index1.GetFieldNames(FieldOption.ALL);
- Assert.AreEqual(fields1.Count, fields2.Count, "IndexReaders have different numbers of fields.");
- System.Collections.IEnumerator it1 = fields1.GetEnumerator();
- System.Collections.IEnumerator it2 = fields1.GetEnumerator();
- while (it1.MoveNext())
+ System.Collections.Generic.ICollection<string> fieldsNames1 = index1.GetFieldNames(FieldOption.ALL);
+ System.Collections.Generic.ICollection<string> fieldsNames2 = index1.GetFieldNames(FieldOption.ALL);
+
+ System.Collections.ICollection fields1 = null;
+ System.Collections.ICollection fields2 = null;
+
+ Assert.AreEqual(fieldsNames1.Count, fieldsNames2.Count, "IndexReaders have different numbers of fields.");
+ System.Collections.IEnumerator it1 = fieldsNames1.GetEnumerator();
+ System.Collections.IEnumerator it2 = fieldsNames2.GetEnumerator();
+ while (it1.MoveNext() && it2.MoveNext())
{
Assert.AreEqual((System.String) it1.Current, (System.String) it2.Current, "Different field names.");
}
// check norms
- it1 = fields1.GetEnumerator();
+ it1 = fieldsNames1.GetEnumerator();
while (it1.MoveNext())
{
System.String curField = (System.String) it1.Current;
@@ -1590,7 +1594,7 @@
Assert.AreEqual(fields1.Count, fields2.Count, "Different numbers of fields for doc " + i + ".");
it1 = fields1.GetEnumerator();
it2 = fields2.GetEnumerator();
- while (it1.MoveNext())
+ while (it1.MoveNext() && it2.MoveNext())
{
Field curField1 = (Field) it1.Current;
Field curField2 = (Field) it2.Current;
@@ -1887,7 +1891,7 @@
while (it.MoveNext())
{
IndexCommit commit = (IndexCommit) it.Current;
- System.Collections.ICollection files = commit.GetFileNames();
+ System.Collections.Generic.ICollection<string> files = commit.GetFileNames();
System.Collections.Hashtable seen = new System.Collections.Hashtable();
System.Collections.IEnumerator it2 = files.GetEnumerator();
while (it2.MoveNext())
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=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReaderReopen.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReaderReopen.cs Sun Nov 15 10:49:32 2009
@@ -1159,7 +1159,7 @@
System.Collections.IEnumerator it = readersToClose.GetEnumerator();
while (it.MoveNext())
{
- ((IndexReader) it.Current).Close();
+ ((IndexReader) ((System.Collections.DictionaryEntry)it.Current).Key).Close();
}
firstReader.Close();
@@ -1168,7 +1168,7 @@
it = readersToClose.GetEnumerator();
while (it.MoveNext())
{
- AssertReaderClosed((IndexReader) it.Current, true, true);
+ AssertReaderClosed((IndexReader)((System.Collections.DictionaryEntry)it.Current).Key, true, true);
}
AssertReaderClosed(reader, true, true);
Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestParallelReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestParallelReader.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestParallelReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestParallelReader.cs Sun Nov 15 10:49:32 2009
@@ -79,7 +79,7 @@
ParallelReader pr = new ParallelReader();
pr.Add(IndexReader.Open(dir1));
pr.Add(IndexReader.Open(dir2));
- System.Collections.ICollection fieldNames = pr.GetFieldNames(IndexReader.FieldOption.ALL);
+ System.Collections.Generic.ICollection<string> fieldNames = pr.GetFieldNames(IndexReader.FieldOption.ALL);
Assert.AreEqual(4, fieldNames.Count);
Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "f1"));
Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "f2"));
Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestSegmentMerger.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestSegmentMerger.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestSegmentMerger.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestSegmentMerger.cs Sun Nov 15 10:49:32 2009
@@ -94,7 +94,7 @@
Assert.IsTrue(termDocs != null);
Assert.IsTrue(termDocs.Next() == true);
- System.Collections.ICollection stored = mergedReader.GetFieldNames(IndexReader.FieldOption.INDEXED_WITH_TERMVECTOR);
+ System.Collections.Generic.ICollection<string> stored = mergedReader.GetFieldNames(IndexReader.FieldOption.INDEXED_WITH_TERMVECTOR);
Assert.IsTrue(stored != null);
//System.out.println("stored size: " + stored.size());
Assert.IsTrue(stored.Count == 4, "We do not have 4 fields that were indexed with term vector");
Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestSegmentReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestSegmentReader.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestSegmentReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestSegmentReader.cs Sun Nov 15 10:49:32 2009
@@ -95,7 +95,7 @@
[Test]
public virtual void TestGetFieldNameVariations()
{
- System.Collections.ICollection result = reader.GetFieldNames(IndexReader.FieldOption.ALL);
+ System.Collections.Generic.ICollection<string> result = reader.GetFieldNames(IndexReader.FieldOption.ALL);
Assert.IsTrue(result != null);
Assert.IsTrue(result.Count == DocHelper.all.Count);
for (System.Collections.IEnumerator iter = result.GetEnumerator(); iter.MoveNext(); )
Modified: incubator/lucene.net/trunk/C#/src/Test/TestSnapshotDeletionPolicy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/TestSnapshotDeletionPolicy.cs?rev=836347&r1=836346&r2=836347&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/TestSnapshotDeletionPolicy.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/TestSnapshotDeletionPolicy.cs Sun Nov 15 10:49:32 2009
@@ -233,7 +233,7 @@
// While we hold the snapshot, and nomatter how long
// we take to do the backup, the IndexWriter will
// never delete the files in the snapshot:
- System.Collections.ICollection files = cp.GetFileNames();
+ System.Collections.Generic.ICollection<string> files = cp.GetFileNames();
System.Collections.IEnumerator it = files.GetEnumerator();
while (it.MoveNext())
{