lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [19/50] [abbrv] lucenenet git commit: Revert "SWEEP: Lucene.Net.Core + Lucene.Net.TestFramework: Changed all string collection .Contains() methods to use the Linq extension that uses StringComparer.Ordinal"
Date Wed, 15 Mar 2017 23:50:01 GMT
Revert "SWEEP: Lucene.Net.Core + Lucene.Net.TestFramework: Changed all string collection .Contains()
methods to use the Linq extension that uses StringComparer.Ordinal"

This reverts commit a51c7f8e81273a0ba739227b85136dde991ca561.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/d67ac269
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/d67ac269
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/d67ac269

Branch: refs/heads/api-work
Commit: d67ac269bf2ce356aab61d8ea62f96a0677edb5d
Parents: 05bf4af
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Mar 15 00:16:22 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Mar 15 00:16:22 2017 +0700

----------------------------------------------------------------------
 .../Document/DocumentStoredFieldVisitor.cs          |  4 +---
 src/Lucene.Net.Core/Index/CheckIndex.cs             |  3 +--
 src/Lucene.Net.Core/Index/IndexWriter.cs            | 12 ++++++------
 src/Lucene.Net.Core/Store/CompoundFileWriter.cs     |  2 +-
 src/Lucene.Net.Core/Store/FileSwitchDirectory.cs    |  4 ++--
 src/Lucene.Net.Core/Store/NRTCachingDirectory.cs    |  2 +-
 .../Store/SingleInstanceLockFactory.cs              |  6 ++----
 src/Lucene.Net.Core/Util/IOUtils.cs                 |  2 +-
 src/Lucene.Net.Core/Util/SPIClassIterator.cs        |  2 +-
 .../Analysis/BaseTokenStreamTestCase.cs             |  2 +-
 .../Index/BasePostingsFormatTestCase.cs             |  6 +++---
 .../Index/FieldFilterAtomicReader.cs                |  4 +---
 src/Lucene.Net.TestFramework/Index/RandomCodec.cs   |  5 ++---
 .../Index/ThreadedIndexingAndSearchingTestCase.cs   |  2 +-
 .../Store/MockDirectoryWrapper.cs                   | 16 ++++++++--------
 src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs |  2 +-
 .../Util/StackTraceHelper.cs                        |  4 ++--
 .../Util/TestRuleSetupAndRestoreClassEnv.cs         |  2 +-
 18 files changed, 36 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Document/DocumentStoredFieldVisitor.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/DocumentStoredFieldVisitor.cs b/src/Lucene.Net.Core/Document/DocumentStoredFieldVisitor.cs
index 5b112d6..3755784 100644
--- a/src/Lucene.Net.Core/Document/DocumentStoredFieldVisitor.cs
+++ b/src/Lucene.Net.Core/Document/DocumentStoredFieldVisitor.cs
@@ -1,7 +1,5 @@
 using Lucene.Net.Index;
-using System;
 using System.Collections.Generic;
-using System.Linq;
 
 namespace Lucene.Net.Documents
 {
@@ -100,7 +98,7 @@ namespace Lucene.Net.Documents
 
         public override Status NeedsField(FieldInfo fieldInfo)
         {
-            return fieldsToAdd == null || fieldsToAdd.Contains(fieldInfo.Name, StringComparer.Ordinal)
? Status.YES : Status.NO;
+            return fieldsToAdd == null || fieldsToAdd.Contains(fieldInfo.Name) ? Status.YES
: Status.NO;
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Index/CheckIndex.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/CheckIndex.cs b/src/Lucene.Net.Core/Index/CheckIndex.cs
index 4f29885..430de6f 100644
--- a/src/Lucene.Net.Core/Index/CheckIndex.cs
+++ b/src/Lucene.Net.Core/Index/CheckIndex.cs
@@ -4,7 +4,6 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Globalization;
 using System.IO;
-using System.Linq;
 
 namespace Lucene.Net.Index
 {
@@ -689,7 +688,7 @@ namespace Lucene.Net.Index
                 {
                     result.MaxSegmentName = segmentName;
                 }
-                if (onlySegments != null && !onlySegments.Contains(info.Info.Name,
StringComparer.Ordinal))
+                if (onlySegments != null && !onlySegments.Contains(info.Info.Name))
                 {
                     continue;
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Index/IndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/IndexWriter.cs b/src/Lucene.Net.Core/Index/IndexWriter.cs
index 09de376..fa9cb72 100644
--- a/src/Lucene.Net.Core/Index/IndexWriter.cs
+++ b/src/Lucene.Net.Core/Index/IndexWriter.cs
@@ -717,7 +717,7 @@ namespace Lucene.Net.Index
                 HashSet<string> seen = new HashSet<string>();
                 foreach (SegmentCommitInfo info in readerMap.Keys)
                 {
-                    Debug.Assert(!seen.Contains(info.Info.Name, StringComparer.Ordinal));
+                    Debug.Assert(!seen.Contains(info.Info.Name));
                     seen.Add(info.Info.Name);
                 }
                 return true;
@@ -3400,7 +3400,7 @@ namespace Lucene.Net.Index
             foreach (string file in info.Files())
             {
                 string newFileName;
-                if (docStoreFiles3xOnly != null && docStoreFiles3xOnly.Contains(file,
StringComparer.Ordinal))
+                if (docStoreFiles3xOnly != null && docStoreFiles3xOnly.Contains(file))
                 {
                     newFileName = newDsName + Lucene.Net.Index.IndexFileNames.StripSegmentName(file);
                 }
@@ -3445,10 +3445,10 @@ namespace Lucene.Net.Index
                 foreach (string file in info.Files())
                 {
                     string newFileName;
-                    if (docStoreFiles3xOnly != null && docStoreFiles3xOnly.Contains(file,
StringComparer.Ordinal))
+                    if (docStoreFiles3xOnly != null && docStoreFiles3xOnly.Contains(file))
                     {
                         newFileName = newDsName + Lucene.Net.Index.IndexFileNames.StripSegmentName(file);
-                        if (dsFilesCopied.Contains(newFileName, StringComparer.Ordinal))
+                        if (dsFilesCopied.Contains(newFileName))
                         {
                             continue;
                         }
@@ -3459,14 +3459,14 @@ namespace Lucene.Net.Index
                         newFileName = segName + Lucene.Net.Index.IndexFileNames.StripSegmentName(file);
                     }
 
-                    if (siFiles.Contains(newFileName, StringComparer.Ordinal))
+                    if (siFiles.Contains(newFileName))
                     {
                         // We already rewrote this above
                         continue;
                     }
 
                     Debug.Assert(!SlowFileExists(directory, newFileName), "file \"" + newFileName
+ "\" already exists; siFiles=" + siFiles);
-                    Debug.Assert(!copiedFiles.Contains(file, StringComparer.Ordinal), "file
\"" + file + "\" is being copied more than once");
+                    Debug.Assert(!copiedFiles.Contains(file), "file \"" + file + "\" is being
copied more than once");
                     copiedFiles.Add(file);
                     info.Info.Dir.Copy(directory, file, newFileName, context);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Store/CompoundFileWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/CompoundFileWriter.cs b/src/Lucene.Net.Core/Store/CompoundFileWriter.cs
index 549d3bd..7783832 100644
--- a/src/Lucene.Net.Core/Store/CompoundFileWriter.cs
+++ b/src/Lucene.Net.Core/Store/CompoundFileWriter.cs
@@ -274,7 +274,7 @@ namespace Lucene.Net.Store
                 entry.File = name;
                 entries[name] = entry;
                 string id = IndexFileNames.StripSegmentName(name);
-                Debug.Assert(!seenIDs.Contains(id, StringComparer.Ordinal), "file=\"" + name
+ "\" maps to id=\"" + id + "\", which was already written");
+                Debug.Assert(!seenIDs.Contains(id), "file=\"" + name + "\" maps to id=\""
+ id + "\", which was already written");
                 seenIDs.Add(id);
                 DirectCFSIndexOutput @out;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Store/FileSwitchDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/FileSwitchDirectory.cs b/src/Lucene.Net.Core/Store/FileSwitchDirectory.cs
index d89081e..acdc8c5 100644
--- a/src/Lucene.Net.Core/Store/FileSwitchDirectory.cs
+++ b/src/Lucene.Net.Core/Store/FileSwitchDirectory.cs
@@ -152,7 +152,7 @@ namespace Lucene.Net.Store
         private Directory GetDirectory(string name)
         {
             string ext = GetExtension(name);
-            if (primaryExtensions.Contains(ext, StringComparer.Ordinal))
+            if (primaryExtensions.Contains(ext))
             {
                 return primaryDir;
             }
@@ -190,7 +190,7 @@ namespace Lucene.Net.Store
 
             foreach (string name in names)
             {
-                if (primaryExtensions.Contains(GetExtension(name), StringComparer.Ordinal))
+                if (primaryExtensions.Contains(GetExtension(name)))
                 {
                     primaryNames.Add(name);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Store/NRTCachingDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/NRTCachingDirectory.cs b/src/Lucene.Net.Core/Store/NRTCachingDirectory.cs
index 93796f3..e9394d0 100644
--- a/src/Lucene.Net.Core/Store/NRTCachingDirectory.cs
+++ b/src/Lucene.Net.Core/Store/NRTCachingDirectory.cs
@@ -145,7 +145,7 @@ namespace Lucene.Net.Store
                     {
                         // Cannot do this -- if lucene calls createOutput but
                         // file already exists then this falsely trips:
-                        //assert !files.contains(f, StringComparer.Ordinal): "file \"" +
f + "\" is in both dirs";
+                        //assert !files.contains(f): "file \"" + f + "\" is in both dirs";
                         files.Add(f);
                     }
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Store/SingleInstanceLockFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/SingleInstanceLockFactory.cs b/src/Lucene.Net.Core/Store/SingleInstanceLockFactory.cs
index a21afe6..da1b5e3 100644
--- a/src/Lucene.Net.Core/Store/SingleInstanceLockFactory.cs
+++ b/src/Lucene.Net.Core/Store/SingleInstanceLockFactory.cs
@@ -1,6 +1,4 @@
-using System;
 using System.Collections.Generic;
-using System.Linq;
 
 namespace Lucene.Net.Store
 {
@@ -47,7 +45,7 @@ namespace Lucene.Net.Store
         {
             lock (locks)
             {
-                if (locks.Contains(lockName, StringComparer.Ordinal))
+                if (locks.Contains(lockName))
                 {
                     locks.Remove(lockName);
                 }
@@ -88,7 +86,7 @@ namespace Lucene.Net.Store
             {
                 lock (locks)
                 {
-                    return locks.Contains(lockName, StringComparer.Ordinal);
+                    return locks.Contains(lockName);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Util/IOUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/IOUtils.cs b/src/Lucene.Net.Core/Util/IOUtils.cs
index 97a264a..c0aad7c 100644
--- a/src/Lucene.Net.Core/Util/IOUtils.cs
+++ b/src/Lucene.Net.Core/Util/IOUtils.cs
@@ -257,7 +257,7 @@ namespace Lucene.Net.Util
         /// suppressed exceptions to a data field. </summary>
         /// <param name="exception"> this exception should get the suppressed one added
</param>
         /// <param name="suppressed"> the suppressed exception </param>
-        private static void AddSuppressed(Exception exception, Exception suppressed) // LUCENENET
TODO: It would be nice if we actually sent this exception somewhere...
+        private static void AddSuppressed(Exception exception, Exception suppressed)
         {
             if (exception != null && suppressed != null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.Core/Util/SPIClassIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/SPIClassIterator.cs b/src/Lucene.Net.Core/Util/SPIClassIterator.cs
index 1ffed0e..a2a3f02 100644
--- a/src/Lucene.Net.Core/Util/SPIClassIterator.cs
+++ b/src/Lucene.Net.Core/Util/SPIClassIterator.cs
@@ -235,7 +235,7 @@ namespace Lucene.Net.Util
 
                 var publicKeyToken = string.Concat(publicKey.Select(i => i.ToString("x2")));
 
-                return s_microsoftKeys.Contains(publicKeyToken, StringComparer.Ordinal);
+                return s_microsoftKeys.Contains(publicKeyToken);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs b/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
index 9f2533e..3efb1ac 100644
--- a/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
@@ -744,7 +744,7 @@ namespace Lucene.Net.Analysis
                     ft.OmitNorms = true;
                 }
                 string pf = TestUtil.GetPostingsFormat("dummy");
-                bool supportsOffsets = !DoesntSupportOffsets.Contains(pf, StringComparer.Ordinal);
+                bool supportsOffsets = !DoesntSupportOffsets.Contains(pf);
                 switch (random.Next(4))
                 {
                     case 0:

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
index 993bc82..f7038f9 100644
--- a/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
@@ -415,7 +415,7 @@ namespace Lucene.Net.Index
                 for (int termUpto = 0; termUpto < numTerms; termUpto++)
                 {
                     string term = TestUtil.RandomSimpleString(Random());
-                    if (seenTerms.Contains(term, StringComparer.Ordinal))
+                    if (seenTerms.Contains(term))
                     {
                         continue;
                     }
@@ -527,7 +527,7 @@ namespace Lucene.Net.Index
 
                 string pf = TestUtil.GetPostingsFormat(codec, oldFieldInfo.Name);
                 int fieldMaxIndexOption;
-                if (DoesntSupportOffsets.Contains(pf, StringComparer.Ordinal))
+                if (DoesntSupportOffsets.Contains(pf))
                 {
                     fieldMaxIndexOption = Math.Min(maxIndexOptionNoOffsets, maxIndexOption);
                 }
@@ -1317,7 +1317,7 @@ namespace Lucene.Net.Index
             {
                 string field = "f_" + opts;
                 string pf = TestUtil.GetPostingsFormat(Codec.Default, field);
-                if (opts == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS &&
DoesntSupportOffsets.Contains(pf, StringComparer.Ordinal))
+                if (opts == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS &&
DoesntSupportOffsets.Contains(pf))
                 {
                     continue;
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs b/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs
index 1efb6e7..e3e66dc 100644
--- a/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs
+++ b/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs
@@ -1,7 +1,5 @@
 using Lucene.Net.Util;
-using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Text;
 
 namespace Lucene.Net.Index
@@ -55,7 +53,7 @@ namespace Lucene.Net.Index
 
         internal bool HasField(string field)
         {
-            return Negate ^ Fields_Renamed.Contains(field, StringComparer.Ordinal);
+            return Negate ^ Fields_Renamed.Contains(field);
         }
 
         public override FieldInfos FieldInfos

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/RandomCodec.cs b/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
index 44bec6e..5ec3003 100644
--- a/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
+++ b/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
@@ -5,7 +5,6 @@ using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Linq;
 
 namespace Lucene.Net.Index
 {
@@ -196,7 +195,7 @@ namespace Lucene.Net.Index
         {
             foreach (PostingsFormat p in postings)
             {
-                if (!avoidCodecs.Contains(p.Name, StringComparer.Ordinal))
+                if (!avoidCodecs.Contains(p.Name))
                 {
                     formats.Add(p);
                     formatNames.Add(p.Name);
@@ -208,7 +207,7 @@ namespace Lucene.Net.Index
         {
             foreach (DocValuesFormat d in docvalues)
             {
-                if (!avoidCodecs.Contains(d.Name, StringComparer.Ordinal))
+                if (!avoidCodecs.Contains(d.Name))
                 {
                     dvFormats.Add(d);
                     dvFormatNames.Add(d.Name);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
index 7d9fa8a..2de1ee4 100644
--- a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
@@ -732,7 +732,7 @@ namespace Lucene.Net.Index
             for (int id = 0; id < endID; id++)
             {
                 string stringID = "" + id;
-                if (!delIDs.Contains(stringID, StringComparer.Ordinal))
+                if (!delIDs.Contains(stringID))
                 {
                     TopDocs hits = s.Search(new TermQuery(new Term("docid", stringID)), 1);
                     if (hits.TotalHits != 1)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
index b386054..9b103c5 100644
--- a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
@@ -594,7 +594,7 @@ namespace Lucene.Net.Store
                     throw new System.IO.IOException("cannot delete after crash");
                 }
 
-                if (UnSyncedFiles.Contains(name, StringComparer.Ordinal))
+                if (UnSyncedFiles.Contains(name))
                 {
                     UnSyncedFiles.Remove(name);
                 }
@@ -661,7 +661,7 @@ namespace Lucene.Net.Store
                 Init();
                 lock (this)
                 {
-                    if (PreventDoubleWrite_Renamed && CreatedFiles.Contains(name,
StringComparer.Ordinal) && !name.Equals("segments.gen", StringComparison.Ordinal))
+                    if (PreventDoubleWrite_Renamed && CreatedFiles.Contains(name)
&& !name.Equals("segments.gen", StringComparison.Ordinal))
                     {
                         throw new System.IO.IOException("file \"" + name + "\" was already
written to");
                     }
@@ -969,7 +969,7 @@ namespace Lucene.Net.Store
                             ISet<string> startSet = new SortedSet<string>(Arrays.AsList(startFiles));
                             ISet<string> endSet = new SortedSet<string>(Arrays.AsList(endFiles));
 
-                            if (pendingDeletions.Contains("segments.gen", StringComparer.Ordinal)
&& endSet.Contains("segments.gen", StringComparer.Ordinal))
+                            if (pendingDeletions.Contains("segments.gen") && endSet.Contains("segments.gen"))
                             {
                                 // this is possible if we hit an exception while writing
segments.gen, we try to delete it
                                 // and it ends out in pendingDeletions (but IFD wont remove
this).
@@ -1009,9 +1009,9 @@ namespace Lucene.Net.Store
                                         ISet<string> ghosts = new HashSet<string>(sis.Files(m_input,
false));
                                         foreach (string s in ghosts)
                                         {
-                                            if (endSet.Contains(s, StringComparer.Ordinal)
&& !startSet.Contains(s, StringComparer.Ordinal))
+                                            if (endSet.Contains(s) && !startSet.Contains(s))
                                             {
-                                                Debug.Assert(pendingDeletions.Contains(s,
StringComparer.Ordinal));
+                                                Debug.Assert(pendingDeletions.Contains(s));
                                                 if (LuceneTestCase.VERBOSE)
                                                 {
                                                     Console.WriteLine("MDW: Unreferenced
check: Ignoring referenced file: " + s + " " + "from " + file + " that we could not delete.");
@@ -1037,7 +1037,7 @@ namespace Lucene.Net.Store
                                 IList<string> removed = new List<string>();
                                 foreach (string fileName in startFiles)
                                 {
-                                    if (!endSet.Contains(fileName, StringComparer.Ordinal))
+                                    if (!endSet.Contains(fileName))
                                     {
                                         removed.Add(fileName);
                                     }
@@ -1046,7 +1046,7 @@ namespace Lucene.Net.Store
                                 IList<string> added = new List<string>();
                                 foreach (string fileName in endFiles)
                                 {
-                                    if (!startSet.Contains(fileName, StringComparer.Ordinal))
+                                    if (!startSet.Contains(fileName))
                                     {
                                         added.Add(fileName);
                                     }
@@ -1323,7 +1323,7 @@ namespace Lucene.Net.Store
             // cannot open a file for input if it's still open for
             // output, except for segments.gen and segments_N
 
-            if (OpenFilesForWrite.Contains(name, StringComparer.Ordinal) && !name.StartsWith("segments",
StringComparison.Ordinal))
+            if (OpenFilesForWrite.Contains(name) && !name.StartsWith("segments",
StringComparison.Ordinal))
             {
                 throw WithAdditionalErrorInformation(new IOException("MockDirectoryWrapper:
file \"" + name + "\" is still open for writing"), name, false);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index e0b6d31..beadd74 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -522,7 +522,7 @@ namespace Lucene.Net.Util
               @Override
               protected bool accept(System.Reflection.FieldInfo field)
               {
-                  if (STATIC_LEAK_IGNORED_TYPES.Contains(field.Type.Name, StringComparer.Ordinal))
+                  if (STATIC_LEAK_IGNORED_TYPES.contains(field.Type.Name))
                   {
                       return false;
                   }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs b/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs
index c0a5ca8..c913b41 100644
--- a/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs
+++ b/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs
@@ -20,7 +20,7 @@ namespace Lucene.Net.Util
         {
 #if FEATURE_STACKTRACE
             IEnumerable<string> allMethods = GetStackTrace(false);
-            return allMethods.Contains(methodName, StringComparer.Ordinal);
+            return allMethods.Contains(methodName);
 #else
             StackTrace trace = new StackTrace();
             foreach (var frame in trace.GetFrames())
@@ -42,7 +42,7 @@ namespace Lucene.Net.Util
         {
 #if FEATURE_STACKTRACE
             IEnumerable<string> allMethods = GetStackTrace(true);
-            return allMethods.Any(x => x.Contains(className + '.' + methodName, StringComparer.Ordinal));
+            return allMethods.Any(x => x.Contains(className + '.' + methodName));
 #else
             StackTrace trace = new StackTrace();
             foreach (var frame in trace.GetFrames())

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d67ac269/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs b/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
index f0c2cfd..2c392ec 100644
--- a/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
+++ b/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
@@ -397,7 +397,7 @@ namespace Lucene.Net.Util
         /// </summary>
         private bool ShouldAvoidCodec(string codec)
         {
-            return avoidCodecs.Count > 0 && avoidCodecs.Contains(codec, StringComparer.Ordinal);
+            return avoidCodecs.Count > 0 && avoidCodecs.Contains(codec);
         }
     }
 }
\ No newline at end of file


Mime
View raw message