lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [lucenenet] 27/42: SWEEP: Added StringComparison.Ordinal to all string.Equals() calls, as per https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings#recommendations-for-string-usage
Date Wed, 07 Aug 2019 22:26:24 GMT
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit c300581a499700ff621eb1ae6825a63d5c26c983
Author: Shad Storhaug <shad@shadstorhaug.com>
AuthorDate: Mon Aug 5 07:58:56 2019 +0700

    SWEEP: Added StringComparison.Ordinal to all string.Equals() calls, as per https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings#recommendations-for-string-usage
---
 .../Analysis/Br/BrazilianStemFilter.cs             |  3 +-
 .../Analysis/Br/BrazilianStemmer.cs                |  7 +--
 .../Analysis/CommonGrams/CommonGramsQueryFilter.cs |  5 ++-
 .../Analysis/Compound/Hyphenation/Hyphen.cs        |  5 ++-
 .../Analysis/Compound/Hyphenation/PatternParser.cs | 12 +++---
 .../Analysis/De/GermanStemFilter.cs                |  3 +-
 .../Analysis/De/GermanStemmer.cs                   | 13 +++---
 .../Analysis/En/KStemmer.cs                        |  2 +-
 .../Analysis/Fr/FrenchStemFilter.cs                |  2 +-
 .../Analysis/Hunspell/Dictionary.cs                | 18 ++++----
 .../Analysis/Miscellaneous/PatternAnalyzer.cs      |  2 +-
 .../Miscellaneous/WordDelimiterFilterFactory.cs    | 12 +++---
 .../Analysis/Nl/DutchStemFilter.cs                 |  2 +-
 .../Analysis/No/NorwegianLightStemFilterFactory.cs |  7 +--
 .../No/NorwegianMinimalStemFilterFactory.cs        |  7 +--
 .../Pattern/PatternReplaceFilterFactory.cs         |  3 +-
 .../Payloads/DelimitedPayloadTokenFilterFactory.cs |  9 ++--
 .../Analysis/Payloads/NumericPayloadTokenFilter.cs |  2 +-
 .../Analysis/Sinks/TokenTypeSinkFilter.cs          |  3 +-
 .../Analysis/Snowball/SnowballAnalyzer.cs          |  4 +-
 .../Analysis/Synonym/FSTSynonymFilterFactory.cs    |  4 +-
 .../Analysis/Synonym/SynonymFilterFactory.cs       |  2 +-
 .../Analysis/Synonym/WordnetSynonymParser.cs       |  2 +-
 .../Analysis/Util/AbstractAnalysisFactory.cs       |  2 +-
 .../Tartarus/Snowball/SnowballProgram.cs           |  3 +-
 .../Icu/ICUNormalizer2CharFilterFactory.cs         |  2 +-
 .../Analysis/Icu/ICUNormalizer2FilterFactory.cs    |  2 +-
 .../Analysis/Icu/ICUTransformFilterFactory.cs      |  2 +-
 .../GraphvizFormatter.cs                           |  3 +-
 .../Tools/BinaryDictionaryWriter.cs                | 12 +++---
 .../DoubleMetaphoneFilter.cs                       |  7 +--
 .../Language/AbstractCaverphone .cs                |  4 +-
 .../Language/Bm/Lang.cs                            |  2 +-
 .../Language/Bm/PhoneticEngine.cs                  |  2 +-
 .../Language/Bm/Rule.cs                            |  4 +-
 .../Language/ColognePhonetic.cs                    |  3 +-
 .../Language/DaitchMokotoffSoundex.cs              |  2 +-
 .../Language/DoubleMetaphone.cs                    |  4 +-
 .../Language/Metaphone.cs                          |  5 ++-
 src/Lucene.Net.Analysis.Phonetic/PhoneticFilter.cs |  2 +-
 .../Egothor.Stemmer/Compile.cs                     |  4 +-
 .../Egothor.Stemmer/DiffIt.cs                      |  4 +-
 .../ByTask/Tasks/CreateIndexTask.cs                |  2 +-
 .../ByTask/Tasks/WriteLineDocTask.cs               |  2 +-
 .../Support/Sax/Ext/Attributes2Impl.cs             |  4 +-
 .../Support/Sax/Helpers/NamespaceSupport.cs        | 14 +++---
 .../Support/TagSoup/Element.cs                     |  3 +-
 .../Support/TagSoup/ElementType.cs                 |  8 ++--
 .../Support/TagSoup/PYXScanner.cs                  |  3 +-
 src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs | 48 ++++++++++-----------
 .../Support/TagSoup/XMLWriter.cs                   | 50 +++++++++++-----------
 .../SimpleText/SimpleTextFieldInfosReader.cs       |  2 +-
 src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs |  5 ++-
 src/Lucene.Net.Demo/IndexFiles.cs                  |  2 +-
 src/Lucene.Net.Demo/SearchFiles.cs                 | 14 +++---
 src/Lucene.Net.Facet/FacetsConfig.cs               |  2 +-
 src/Lucene.Net.Facet/LabelAndValue.cs              |  2 +-
 src/Lucene.Net.Facet/Range/RangeFacetCounts.cs     |  5 ++-
 .../DefaultSortedSetDocValuesReaderState.cs        |  3 +-
 src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs      |  2 +-
 .../Taxonomy/Directory/DirectoryTaxonomyReader.cs  |  2 +-
 src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs        |  2 +-
 .../Taxonomy/PrintTaxonomyStats.cs                 |  2 +-
 src/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs    |  4 +-
 .../Highlight/QueryTermExtractor.cs                |  2 +-
 .../Highlight/WeightedSpanTermExtractor.cs         |  4 +-
 .../PostingsHighlight/MultiTermHighlighting.cs     |  8 ++--
 .../VectorHighlight/FieldQuery.cs                  |  4 +-
 src/Lucene.Net.Join/TermsIncludingScoreQuery.cs    |  3 +-
 .../MemoryIndex.MemoryIndexReader.cs               |  2 +-
 src/Lucene.Net.Misc/Document/LazyDocument.cs       |  2 +-
 src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs |  4 +-
 src/Lucene.Net.Misc/Index/IndexSplitter.cs         |  8 ++--
 .../Index/MultiPassIndexSplitter.cs                |  6 +--
 .../Index/Sorter/SortingMergePolicy.cs             |  2 +-
 src/Lucene.Net.Misc/Misc/HighFreqTerms.cs          |  2 +-
 .../Function/ValueSources/DocFreqValueSource.cs    |  2 +-
 .../Function/ValueSources/FieldCacheSource.cs      |  3 +-
 .../ValueSources/JoinDocFreqValueSource.cs         |  2 +-
 .../Function/ValueSources/LiteralValueSource.cs    |  3 +-
 .../Function/ValueSources/MultiFloatFunction.cs    |  3 +-
 .../Function/ValueSources/NormValueSource.cs       |  3 +-
 .../Function/ValueSources/OrdFieldSource.cs        |  3 +-
 .../Function/ValueSources/ReverseOrdFieldSource.cs |  3 +-
 .../Function/ValueSources/SingleFunction.cs        |  3 +-
 .../ValueSources/SumTotalTermFreqValueSource.cs    |  3 +-
 .../ValueSources/TotalTermFreqValueSource.cs       |  3 +-
 src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs    |  5 ++-
 src/Lucene.Net.Queries/TermsFilter.cs              |  4 +-
 src/Lucene.Net.QueryParser/Classic/QueryParser.cs  |  4 +-
 .../Classic/QueryParserBase.cs                     |  4 +-
 .../ComplexPhrase/ComplexPhraseQueryParser.cs      |  6 +--
 .../Flexible/Core/Nodes/QueryNodeImpl.cs           |  2 +-
 .../Standard/Nodes/AbstractRangeQueryNode.cs       |  4 +-
 .../Processors/MatchAllDocsQueryNodeProcessor.cs   |  5 ++-
 .../Processors/OpenRangeQueryNodeProcessor.cs      |  5 ++-
 .../Surround/Query/RewriteQuery.cs                 |  2 +-
 .../Surround/Query/SrndQuery.cs                    |  2 +-
 .../Xml/Builders/BooleanQueryBuilder.cs            |  2 +-
 src/Lucene.Net.QueryParser/Xml/DOMUtils.cs         | 12 +++---
 .../IndexAndTaxonomyRevision.cs                    |  4 +-
 .../IndexReplicationHandler.cs                     |  4 +-
 src/Lucene.Net.Replicator/IndexRevision.cs         |  4 +-
 src/Lucene.Net.Replicator/RevisionFile.cs          |  2 +-
 src/Lucene.Net.Sandbox/Queries/DuplicateFilter.cs  |  3 +-
 src/Lucene.Net.Sandbox/Queries/SlowFuzzyQuery.cs   |  2 +-
 src/Lucene.Net.Spatial/DisjointSpatialFilter.cs    |  2 +-
 .../Prefix/AbstractPrefixTreeFilter.cs             |  3 +-
 src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs         |  2 +-
 .../Serialized/SerializedDVStrategy.cs             |  2 +-
 src/Lucene.Net.Suggest/Spell/SpellChecker.cs       |  2 +-
 .../Suggest/Analyzing/AnalyzingInfixSuggester.cs   |  2 +-
 .../CharFilters/HTMLStripCharFilterTest.cs         |  2 +-
 .../Analysis/Core/TestStopFilter.cs                |  2 +-
 .../Analysis/Hunspell/TestAllDictionaries.cs       |  2 +-
 .../Analysis/Hunspell/TestAllDictionaries2.cs      |  2 +-
 .../Miscellaneous/TestASCIIFoldingFilter.cs        |  3 +-
 .../TestLucene47WordDelimiterFilter.cs             |  2 +-
 .../Miscellaneous/TestWordDelimiterFilter.cs       |  2 +-
 .../Pattern/TestPatternReplaceCharFilter.cs        |  4 +-
 .../Payloads/NumericPayloadTokenFilterTest.cs      |  8 ++--
 .../Payloads/TypeAsPayloadTokenFilterTest.cs       |  5 ++-
 .../Analysis/Sinks/TestTeeSinkTokenFilter.cs       |  4 +-
 .../Analysis/Sinks/TokenTypeSinkTokenizerTest.cs   |  9 ++--
 .../Analysis/Synonym/TestSynonymMap.cs             |  4 +-
 .../Analysis/Util/TestBufferedCharFilter.cs        | 14 +++---
 .../Language/Bm/BeiderMorseEncoderTest.cs          |  2 +-
 .../Language/Bm/PhoneticEngineRegressionTest.cs    |  2 +-
 .../Egothor.Stemmer/TestCompile.cs                 |  2 +-
 .../ByTask/TestPerfTasksLogic.cs                   | 10 ++---
 .../Range/TestRangeFacetCounts.cs                  |  2 +-
 .../SortedSet/TestSortedSetDocValuesFacets.cs      |  2 +-
 .../Directory/TestDirectoryTaxonomyWriter.cs       |  2 +-
 .../Taxonomy/TestTaxonomyCombined.cs               |  2 +-
 .../Taxonomy/TestTaxonomyFacetCounts.cs            |  2 +-
 .../Taxonomy/TestTaxonomyFacetSumValueSource.cs    |  2 +-
 src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs   |  2 +-
 src/Lucene.Net.Tests.Facet/TestDrillSideways.cs    |  6 +--
 .../Highlight/HighlighterTest.cs                   |  8 ++--
 .../PostingsHighlight/TestPostingsHighlighter.cs   |  2 +-
 .../VectorHighlight/SimpleFragmentsBuilderTest.cs  |  4 +-
 src/Lucene.Net.Tests.Join/TestBlockJoin.cs         |  2 +-
 src/Lucene.Net.Tests.Join/TestJoinUtil.cs          |  2 +-
 .../Document/TestLazyDocument.cs                   | 24 +++++------
 .../Index/Sorter/SorterTestBase.cs                 |  2 +-
 .../Misc/SweetSpotSimilarityTest.cs                |  8 ++--
 .../CommonTermsQueryTest.cs                        |  2 +-
 .../Function/TestOrdValues.cs                      |  3 +-
 .../Function/TestValueSources.cs                   |  4 +-
 .../Classic/TestMultiAnalyzer.cs                   |  8 ++--
 .../Classic/TestMultiFieldQueryParser.cs           |  2 +-
 .../Classic/TestQueryParser.cs                     |  2 +-
 .../Precedence/TestPrecedenceQueryParser.cs        | 14 +++---
 .../Flexible/Spans/UniqueFieldAttributeImpl.cs     |  2 +-
 .../Flexible/Standard/TestMultiAnalyzerQPHelper.cs |  8 ++--
 .../Flexible/Standard/TestMultiFieldQPHelper.cs    |  2 +-
 .../Flexible/Standard/TestNumericQueryParser.cs    | 10 ++---
 .../Flexible/Standard/TestQPHelper.cs              | 18 ++++----
 .../Util/QueryParserTestBase.cs                    | 18 ++++----
 .../IndexAndTaxonomyRevisionTest.cs                |  4 +-
 .../IndexRevisionTest.cs                           |  2 +-
 src/Lucene.Net.Tests.Spatial/TestTestFramework.cs  |  2 +-
 .../Spell/TestDirectSpellChecker.cs                |  2 +-
 .../Spell/TestLuceneDictionary.cs                  |  7 +--
 .../Spell/TestSpellChecker.cs                      |  2 +-
 .../Spell/TestWordBreakSpellChecker.cs             | 42 +++++++++---------
 .../Suggest/Analyzing/AnalyzingSuggesterTest.cs    |  2 +-
 .../Suggest/Analyzing/FuzzySuggesterTest.cs        |  2 +-
 .../Suggest/Fst/FSTCompletionTest.cs               |  4 +-
 .../Analysis/TestGraphTokenizers.cs                |  2 +-
 .../Analysis/TrivialLookaheadFilter.cs             |  3 +-
 .../Codecs/Lucene3x/TestSurrogates.cs              |  8 ++--
 .../Codecs/PerField/TestPerFieldDocValuesFormat.cs |  2 +-
 .../Codecs/PerField/TestPerFieldPostingsFormat2.cs | 14 +++---
 .../Document/TestBinaryDocument.cs                 |  8 ++--
 src/Lucene.Net.Tests/Document/TestDateTools.cs     |  4 +-
 src/Lucene.Net.Tests/Document/TestDocument.cs      | 35 +++++++--------
 src/Lucene.Net.Tests/Index/Test2BTerms.cs          |  2 +-
 src/Lucene.Net.Tests/Index/TestAddIndexes.cs       |  6 +--
 .../Index/TestAllFilesHaveChecksumFooter.cs        |  2 +-
 .../Index/TestAllFilesHaveCodecHeader.cs           |  4 +-
 src/Lucene.Net.Tests/Index/TestBagOfPositions.cs   |  2 +-
 src/Lucene.Net.Tests/Index/TestBagOfPostings.cs    |  2 +-
 .../Index/TestConcurrentMergeScheduler.cs          |  2 +-
 .../Index/TestCrashCausesCorruptIndex.cs           |  2 +-
 .../Index/TestDocInverterPerFieldErrorInfo.cs      |  2 +-
 src/Lucene.Net.Tests/Index/TestDocumentWriter.cs   | 11 ++---
 .../Index/TestFilterAtomicReader.cs                |  2 +-
 src/Lucene.Net.Tests/Index/TestIndexFileDeleter.cs |  2 +-
 src/Lucene.Net.Tests/Index/TestIndexWriter.cs      |  4 +-
 .../Index/TestIndexWriterCommit.cs                 |  6 +--
 .../Index/TestIndexWriterConfig.cs                 |  4 +-
 .../Index/TestIndexWriterDelete.cs                 |  6 +--
 .../Index/TestIndexWriterExceptions.cs             | 12 +++---
 .../Index/TestIndexWriterMerging.cs                |  2 +-
 .../Index/TestIndexWriterOnDiskFull.cs             |  2 +-
 .../Index/TestIndexWriterOnJRECrash.cs             |  2 +-
 .../Index/TestIndexWriterReader.cs                 | 14 ++++--
 src/Lucene.Net.Tests/Index/TestLazyProxSkipping.cs |  6 +--
 src/Lucene.Net.Tests/Index/TestLongPostings.cs     |  5 ++-
 src/Lucene.Net.Tests/Index/TestNoMergePolicy.cs    |  3 +-
 src/Lucene.Net.Tests/Index/TestNorms.cs            |  2 +-
 .../Index/TestPerSegmentDeletes.cs                 |  2 +-
 .../Index/TestPersistentSnapshotDeletionPolicy.cs  |  2 +-
 src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs  |  4 +-
 src/Lucene.Net.Tests/Index/TestRollingUpdates.cs   |  2 +-
 src/Lucene.Net.Tests/Index/TestSegmentReader.cs    |  4 +-
 src/Lucene.Net.Tests/Index/TestTermsEnum2.cs       |  3 +-
 .../Search/Payloads/PayloadHelper.cs               |  4 +-
 .../Search/Payloads/TestPayloadTermQuery.cs        |  5 ++-
 .../Search/Similarities/TestSimilarityBase.cs      |  2 +-
 .../Search/TestDisjunctionMaxQuery.cs              |  4 +-
 .../Search/TestDocValuesScoring.cs                 |  3 +-
 src/Lucene.Net.Tests/Search/TestFieldCache.cs      |  4 +-
 .../Search/TestMultiThreadTermVectors.cs           |  2 +-
 .../Search/TestPositionIncrement.cs                |  2 +-
 src/Lucene.Net.Tests/Search/TestPrefixRandom.cs    |  3 +-
 src/Lucene.Net.Tests/Search/TestRegexpQuery.cs     |  3 +-
 src/Lucene.Net.Tests/Search/TestRegexpRandom2.cs   |  2 +-
 src/Lucene.Net.Tests/Search/TestSearchAfter.cs     |  4 +-
 .../Search/TestSimilarityProvider.cs               |  3 +-
 .../Support/IO/TestStreamTokenizer.cs              | 18 ++++----
 .../Support/TestDictionaryExtensions.cs            |  8 ++--
 src/Lucene.Net.Tests/Support/TestEquatableList.cs  |  2 +-
 src/Lucene.Net.Tests/Support/TestEquatableSet.cs   |  2 +-
 .../Support/TestStringTokenizer.cs                 |  4 +-
 src/Lucene.Net.Tests/TestExternalCodecs.cs         |  4 +-
 .../Util/Automaton/TestLevenshteinAutomata.cs      |  2 +-
 src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs          | 18 ++++----
 src/Lucene.Net.Tests/Util/TestFilterIterator.cs    |  8 ++--
 src/Lucene.Net.Tests/Util/TestQueryBuilder.cs      |  5 ++-
 src/Lucene.Net/Analysis/Token.cs                   |  3 +-
 src/Lucene.Net/Index/UpgradeIndexMergePolicy.cs    |  2 +-
 src/Lucene.Net/Support/Arrays.cs                   |  2 +-
 src/Lucene.Net/Support/AssemblyExtensions.cs       |  6 +--
 235 files changed, 624 insertions(+), 560 deletions(-)

diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemFilter.cs
index 0b94e4c..f26e496 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemFilter.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.TokenAttributes;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Analysis.Br
@@ -61,7 +62,7 @@ namespace Lucene.Net.Analysis.Br
                 {
                     string s = stemmer.Stem(term);
                     // If not stemmed, don't waste the time adjusting the token.
-                    if ((s != null) && !s.Equals(term))
+                    if ((s != null) && !s.Equals(term, StringComparison.Ordinal))
                     {
                         termAtt.SetEmpty().Append(s);
                     }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemmer.cs
index 3d35ee5..95c7ad2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemmer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemmer.cs
@@ -1,4 +1,5 @@
-using System.Globalization;
+using System;
+using System.Globalization;
 
 namespace Lucene.Net.Analysis.Br
 {
@@ -331,7 +332,7 @@ namespace Lucene.Net.Analysis.Br
                 return false;
             }
 
-            return value.Substring(value.Length - suffix.Length).Equals(suffix);
+            return value.Substring(value.Length - suffix.Length).Equals(suffix, StringComparison.Ordinal);
         }
 
         /// <summary>
@@ -350,7 +351,7 @@ namespace Lucene.Net.Analysis.Br
 
             vvalue = RemoveSuffix(value, toReplace);
 
-            if (value.Equals(vvalue))
+            if (value.Equals(vvalue, StringComparison.Ordinal))
             {
                 return value;
             }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsQueryFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsQueryFilter.cs
index 2b59887..878a7c9 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsQueryFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsQueryFilter.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.TokenAttributes;
+using System;
 
 namespace Lucene.Net.Analysis.CommonGrams
 {
@@ -112,7 +113,7 @@ namespace Lucene.Net.Analysis.CommonGrams
 
             exhausted = true;
 
-            if (previous == null || CommonGramsFilter.GRAM_TYPE.Equals(previousType))
+            if (previous == null || CommonGramsFilter.GRAM_TYPE.Equals(previousType, StringComparison.Ordinal))
             {
                 return false;
             }
@@ -137,7 +138,7 @@ namespace Lucene.Net.Analysis.CommonGrams
         {
             get
             {
-                return CommonGramsFilter.GRAM_TYPE.Equals(typeAttribute.Type);
+                return CommonGramsFilter.GRAM_TYPE.Equals(typeAttribute.Type, StringComparison.Ordinal);
             }
         }
     }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/Hyphen.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/Hyphen.cs
index 0fb57d9..8fc13cf 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/Hyphen.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/Hyphen.cs
@@ -1,4 +1,5 @@
-using System.Text;
+using System;
+using System.Text;
 
 namespace Lucene.Net.Analysis.Compound.Hyphenation
 {
@@ -55,7 +56,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
 
         public override string ToString()
         {
-            if (NoBreak == null && PostBreak == null && PreBreak != null && PreBreak.Equals("-"))
+            if (NoBreak == null && PostBreak == null && PreBreak != null && PreBreak.Equals("-", StringComparison.Ordinal))
             {
                 return "-";
             }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
index 57617be..f73d675 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
@@ -402,7 +402,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
             public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
             {
                 string dtdFilename = "hyphenation.dtd";
-                if (dtdFilename.Equals(absoluteUri.Segments.LastOrDefault()))
+                if (dtdFilename.Equals(absoluteUri.Segments.LastOrDefault(), StringComparison.Ordinal))
                 {
                     return GetType().GetTypeInfo().Assembly.FindAndGetManifestResourceStream(typeof(PatternParser), dtdFilename);
                 }
@@ -430,7 +430,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
         /// <param name="attrs"> the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined</param>
         public virtual void StartElement(string uri, string local, string raw, IDictionary<string, string> attrs)
         {
-            if (local.Equals("hyphen-char"))
+            if (local.Equals("hyphen-char", StringComparison.Ordinal))
             {
                 string h = attrs.ContainsKey("value") ? attrs["value"] : null;
                 if (h != null && h.Length == 1)
@@ -438,20 +438,20 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
                     hyphenChar = h[0];
                 }
             }
-            else if (local.Equals("classes"))
+            else if (local.Equals("classes", StringComparison.Ordinal))
             {
                 currElement = ELEM_CLASSES;
             }
-            else if (local.Equals("patterns"))
+            else if (local.Equals("patterns", StringComparison.Ordinal))
             {
                 currElement = ELEM_PATTERNS;
             }
-            else if (local.Equals("exceptions"))
+            else if (local.Equals("exceptions", StringComparison.Ordinal))
             {
                 currElement = ELEM_EXCEPTIONS;
                 exception = new List<object>();
             }
-            else if (local.Equals("hyphen"))
+            else if (local.Equals("hyphen", StringComparison.Ordinal))
             {
                 if (token.Length > 0)
                 {
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemFilter.cs
index cd4291c..1f6240c 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemFilter.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.TokenAttributes;
+using System;
 
 namespace Lucene.Net.Analysis.De
 {
@@ -63,7 +64,7 @@ namespace Lucene.Net.Analysis.De
                 {
                     string s = stemmer.Stem(term);
                     // If not stemmed, don't waste the time adjusting the token.
-                    if ((s != null) && !s.Equals(term))
+                    if ((s != null) && !s.Equals(term, StringComparison.Ordinal))
                     {
                         termAtt.SetEmpty().Append(s);
                     }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemmer.cs
index 47e9074..4fdd1da 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemmer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemmer.cs
@@ -1,4 +1,5 @@
-using System.Globalization;
+using System;
+using System.Globalization;
 using System.Text;
 
 namespace Lucene.Net.Analysis.De
@@ -98,15 +99,15 @@ namespace Lucene.Net.Analysis.De
             bool doMore = true;
             while (doMore && buffer.Length > 3)
             {
-                if ((buffer.Length + substCount > 5) && buffer.ToString(buffer.Length - 2, buffer.Length - (buffer.Length - 2)).Equals("nd"))
+                if ((buffer.Length + substCount > 5) && buffer.ToString(buffer.Length - 2, buffer.Length - (buffer.Length - 2)).Equals("nd", StringComparison.Ordinal))
                 {
                     buffer.Remove(buffer.Length - 2, buffer.Length - (buffer.Length - 2));
                 }
-                else if ((buffer.Length + substCount > 4) && buffer.ToString(buffer.Length - 2, buffer.Length - (buffer.Length - 2)).Equals("em"))
+                else if ((buffer.Length + substCount > 4) && buffer.ToString(buffer.Length - 2, buffer.Length - (buffer.Length - 2)).Equals("em", StringComparison.Ordinal))
                 {
                     buffer.Remove(buffer.Length - 2, buffer.Length - (buffer.Length - 2));
                 }
-                else if ((buffer.Length + substCount > 4) && buffer.ToString(buffer.Length - 2, buffer.Length - (buffer.Length - 2)).Equals("er"))
+                else if ((buffer.Length + substCount > 4) && buffer.ToString(buffer.Length - 2, buffer.Length - (buffer.Length - 2)).Equals("er", StringComparison.Ordinal))
                 {
                     buffer.Remove(buffer.Length - 2, buffer.Length - (buffer.Length - 2));
                 }
@@ -141,7 +142,7 @@ namespace Lucene.Net.Analysis.De
         private void Optimize(StringBuilder buffer)
         {
             // Additional step for female plurals of professions and inhabitants.
-            if (buffer.Length > 5 && buffer.ToString(buffer.Length - 5, buffer.Length - (buffer.Length - 5)).Equals("erin*"))
+            if (buffer.Length > 5 && buffer.ToString(buffer.Length - 5, buffer.Length - (buffer.Length - 5)).Equals("erin*", StringComparison.Ordinal))
             {
                 buffer.Remove(buffer.Length - 1, 1);
                 Strip(buffer);
@@ -163,7 +164,7 @@ namespace Lucene.Net.Analysis.De
             {
                 for (int c = 0; c < buffer.Length - 3; c++)
                 {
-                    if (buffer.ToString(c, 4).Equals("gege"))
+                    if (buffer.ToString(c, 4).Equals("gege", StringComparison.Ordinal))
                     {
                         buffer.Remove(c, (c + 2) - c);
                         return;
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs
index c446532..3647dd8 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs
@@ -2059,7 +2059,7 @@ namespace Lucene.Net.Analysis.En
             // **
 
             //*
-            // if (entry == null) { if (!word.toString().equals(new String(term,0,len)))
+            // if (entry == null) { if (!word.toString().equals(new String(term,0,len), StringComparison.Ordinal))
             // { System.out.println("CASE:" + word.toString() + "," + new
             // String(term,0,len));
             // 
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Fr/FrenchStemFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Fr/FrenchStemFilter.cs
index b14365b..2c08775 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Fr/FrenchStemFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Fr/FrenchStemFilter.cs
@@ -65,7 +65,7 @@ namespace Lucene.Net.Analysis.Fr
                 {
                     string s = stemmer.Stem(term);
                     // If not stemmed, don't waste the time  adjusting the token.
-                    if ((s != null) && !s.Equals(term))
+                    if ((s != null) && !s.Equals(term, StringComparison.Ordinal))
                     {
                         termAtt.SetEmpty().Append(s);
                     }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs
index 55037ff..ba7efaa 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs
@@ -303,7 +303,7 @@ namespace Lucene.Net.Analysis.Hunspell
                     // Store the strategy so it can be used when parsing the dic file
                     flagParsingStrategy = GetFlagParsingStrategy(line);
                 }
-                else if (line.Equals(COMPLEXPREFIXES_KEY))
+                else if (line.Equals(COMPLEXPREFIXES_KEY, StringComparison.Ordinal))
                 {
                     complexPrefixes = true; // 2-stage prefix+1-stage suffix instead of 2-stage suffix+1-stage prefix
                 }
@@ -337,7 +337,7 @@ namespace Lucene.Net.Analysis.Hunspell
                     }
                     int num = int.Parse(parts[1], CultureInfo.InvariantCulture);
                     FST<CharsRef> res = ParseConversions(reader, num);
-                    if (type.Equals("ICONV"))
+                    if (type.Equals("ICONV", StringComparison.Ordinal))
                     {
                         iconv = res;
                         needsInputCleaning |= iconv != null;
@@ -409,7 +409,7 @@ namespace Lucene.Net.Analysis.Hunspell
             StringBuilder sb = new StringBuilder();
             string[] args = whitespacePattern.Split(header).TrimEnd();
 
-            bool crossProduct = args[2].Equals("Y");
+            bool crossProduct = args[2].Equals("Y", StringComparison.Ordinal);
 
             int numLines = int.Parse(args[3], CultureInfo.InvariantCulture);
             affixData = ArrayUtil.Grow(affixData, (currentAffix << 3) + (numLines << 3));
@@ -429,7 +429,7 @@ namespace Lucene.Net.Analysis.Hunspell
                 }
 
                 char flag = flagParsingStrategy.ParseFlag(ruleArgs[1]);
-                string strip = ruleArgs[2].Equals("0") ? "" : ruleArgs[2];
+                string strip = ruleArgs[2].Equals("0", StringComparison.Ordinal) ? "" : ruleArgs[2];
                 string affixArg = ruleArgs[3];
                 char[] appendFlags = null;
 
@@ -464,11 +464,11 @@ namespace Lucene.Net.Analysis.Hunspell
                 }
 
                 string regex;
-                if (".".Equals(condition))
+                if (".".Equals(condition, StringComparison.Ordinal))
                 {
                     regex = ".*"; // Zero condition is indicated by dot
                 }
-                else if (condition.Equals(strip))
+                else if (condition.Equals(strip, StringComparison.Ordinal))
                 {
                     regex = ".*"; // TODO: optimize this better:
                                   // if we remove 'strip' from condition, we don't have to append 'strip' to check it...!
@@ -690,15 +690,15 @@ namespace Lucene.Net.Analysis.Hunspell
             }
             string flagType = parts[1];
 
-            if (NUM_FLAG_TYPE.Equals(flagType))
+            if (NUM_FLAG_TYPE.Equals(flagType, StringComparison.Ordinal))
             {
                 return new NumFlagParsingStrategy();
             }
-            else if (UTF8_FLAG_TYPE.Equals(flagType))
+            else if (UTF8_FLAG_TYPE.Equals(flagType, StringComparison.Ordinal))
             {
                 return new SimpleFlagParsingStrategy();
             }
-            else if (LONG_FLAG_TYPE.Equals(flagType))
+            else if (LONG_FLAG_TYPE.Equals(flagType, StringComparison.Ordinal))
             {
                 return new DoubleASCIIFlagParsingStrategy();
             }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
index bc596e2..70e7ce2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
@@ -295,7 +295,7 @@ namespace Lucene.Net.Analysis.Miscellaneous
         /// assumes p1 and p2 are not null </summary>
         private static bool EqPattern(Regex p1, Regex p2)
         {
-            return p1 == p2 || (p1.Options == p2.Options && p1.ToString().Equals(p2.ToString()));
+            return p1 == p2 || (p1.Options == p2.Options && p1.ToString().Equals(p2.ToString(), StringComparison.Ordinal));
         }
 
         /// <summary>
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs
index 32600b0..bbf1eed 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs
@@ -179,27 +179,27 @@ namespace Lucene.Net.Analysis.Miscellaneous
 
         private byte ParseType(string s)
         {
-            if (s.Equals("LOWER"))
+            if (s.Equals("LOWER", StringComparison.Ordinal))
             {
                 return WordDelimiterFilter.LOWER;
             }
-            else if (s.Equals("UPPER"))
+            else if (s.Equals("UPPER", StringComparison.Ordinal))
             {
                 return WordDelimiterFilter.UPPER;
             }
-            else if (s.Equals("ALPHA"))
+            else if (s.Equals("ALPHA", StringComparison.Ordinal))
             {
                 return WordDelimiterFilter.ALPHA;
             }
-            else if (s.Equals("DIGIT"))
+            else if (s.Equals("DIGIT", StringComparison.Ordinal))
             {
                 return WordDelimiterFilter.DIGIT;
             }
-            else if (s.Equals("ALPHANUM"))
+            else if (s.Equals("ALPHANUM", StringComparison.Ordinal))
             {
                 return WordDelimiterFilter.ALPHANUM;
             }
-            else if (s.Equals("SUBWORD_DELIM"))
+            else if (s.Equals("SUBWORD_DELIM", StringComparison.Ordinal))
             {
                 return WordDelimiterFilter.SUBWORD_DELIM;
             }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Nl/DutchStemFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Nl/DutchStemFilter.cs
index 8fd66ac..afb50a2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Nl/DutchStemFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Nl/DutchStemFilter.cs
@@ -80,7 +80,7 @@ namespace Lucene.Net.Analysis.Nl
                 {
                     string s = stemmer.Stem(term);
                     // If not stemmed, don't waste the time adjusting the token.
-                    if ((s != null) && !s.Equals(term))
+                    if ((s != null) && !s.Equals(term, StringComparison.Ordinal))
                     {
                         termAtt.SetEmpty().Append(s);
                     }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/No/NorwegianLightStemFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/No/NorwegianLightStemFilterFactory.cs
index c32716f..b4dfcf9 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/No/NorwegianLightStemFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/No/NorwegianLightStemFilterFactory.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.Util;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Analysis.No
@@ -41,15 +42,15 @@ namespace Lucene.Net.Analysis.No
               : base(args)
         {
             string variant = Get(args, "variant");
-            if (variant == null || "nb".Equals(variant))
+            if (variant == null || "nb".Equals(variant, StringComparison.Ordinal))
             {
                 flags = NorwegianStandard.BOKMAAL;
             }
-            else if ("nn".Equals(variant))
+            else if ("nn".Equals(variant, StringComparison.Ordinal))
             {
                 flags = NorwegianStandard.NYNORSK;
             }
-            else if ("no".Equals(variant))
+            else if ("no".Equals(variant, StringComparison.Ordinal))
             {
                 flags = NorwegianStandard.BOKMAAL | NorwegianStandard.NYNORSK;
             }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/No/NorwegianMinimalStemFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/No/NorwegianMinimalStemFilterFactory.cs
index ac1e68c..42f3dc2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/No/NorwegianMinimalStemFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/No/NorwegianMinimalStemFilterFactory.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.Util;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Analysis.No
@@ -41,15 +42,15 @@ namespace Lucene.Net.Analysis.No
             : base(args)
         {
             string variant = Get(args, "variant");
-            if (variant == null || "nb".Equals(variant))
+            if (variant == null || "nb".Equals(variant, StringComparison.Ordinal))
             {
                 flags = NorwegianStandard.BOKMAAL;
             }
-            else if ("nn".Equals(variant))
+            else if ("nn".Equals(variant, StringComparison.Ordinal))
             {
                 flags = NorwegianStandard.NYNORSK;
             }
-            else if ("no".Equals(variant))
+            else if ("no".Equals(variant, StringComparison.Ordinal))
             {
                 flags = NorwegianStandard.BOKMAAL | NorwegianStandard.NYNORSK;
             }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternReplaceFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternReplaceFilterFactory.cs
index ec5a4ab..2ee4727 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternReplaceFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternReplaceFilterFactory.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Analysis.Util;
 using Lucene.Net.Support;
+using System;
 using System.Collections.Generic;
 using System.Text.RegularExpressions;
 
@@ -46,7 +47,7 @@ namespace Lucene.Net.Analysis.Pattern
         {
             pattern = GetPattern(args, "pattern");
             replacement = Get(args, "replacement");
-            replaceAll = "all".Equals(Get(args, "replace", Arrays.AsList("all", "first"), "all"));
+            replaceAll = "all".Equals(Get(args, "replace", Arrays.AsList("all", "first"), "all"), StringComparison.Ordinal);
             if (args.Count > 0)
             {
                 throw new System.ArgumentException("Unknown parameters: " + args);
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
index 20a85ea..cf51cad 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using Lucene.Net.Analysis.Util;
 
 namespace Lucene.Net.Analysis.Payloads
@@ -60,15 +61,15 @@ namespace Lucene.Net.Analysis.Payloads
 
         public virtual void Inform(IResourceLoader loader)
         {
-            if (encoderClass.Equals("float"))
+            if (encoderClass.Equals("float", StringComparison.Ordinal))
             {
                 encoder = new SingleEncoder();
             }
-            else if (encoderClass.Equals("integer"))
+            else if (encoderClass.Equals("integer", StringComparison.Ordinal))
             {
                 encoder = new IntegerEncoder();
             }
-            else if (encoderClass.Equals("identity"))
+            else if (encoderClass.Equals("identity", StringComparison.Ordinal))
             {
                 encoder = new IdentityEncoder();
             }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs
index bd730aa..0e4f713 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs
@@ -50,7 +50,7 @@ namespace Lucene.Net.Analysis.Payloads
         {
             if (m_input.IncrementToken())
             {
-                if (typeAtt.Type.Equals(typeMatch))
+                if (typeAtt.Type.Equals(typeMatch, StringComparison.Ordinal))
                 {
                     payloadAtt.Payload = thePayload;
                 }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Sinks/TokenTypeSinkFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Sinks/TokenTypeSinkFilter.cs
index 31e29ae..f473bdc 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Sinks/TokenTypeSinkFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Sinks/TokenTypeSinkFilter.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Util;
+using System;
 
 namespace Lucene.Net.Analysis.Sinks
 {
@@ -41,7 +42,7 @@ namespace Lucene.Net.Analysis.Sinks
             }
 
             //check to see if this is a Category
-            return (typeToMatch.Equals(typeAtt.Type));
+            return (typeToMatch.Equals(typeAtt.Type, StringComparison.Ordinal));
         }
     }
 }
\ No newline at end of file
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Snowball/SnowballAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Snowball/SnowballAnalyzer.cs
index a6d2be2..24e9be9 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Snowball/SnowballAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Snowball/SnowballAnalyzer.cs
@@ -74,12 +74,12 @@ namespace Lucene.Net.Analysis.Snowball
             Tokenizer tokenizer = new StandardTokenizer(matchVersion, reader);
             TokenStream result = new StandardFilter(matchVersion, tokenizer);
             // remove the possessive 's for english stemmers
-            if (matchVersion.OnOrAfter(LuceneVersion.LUCENE_31) && (name.Equals("English") || name.Equals("Porter") || name.Equals("Lovins")))
+            if (matchVersion.OnOrAfter(LuceneVersion.LUCENE_31) && (name.Equals("English", StringComparison.Ordinal) || name.Equals("Porter", StringComparison.Ordinal) || name.Equals("Lovins", StringComparison.Ordinal)))
             {
                 result = new EnglishPossessiveFilter(result);
             }
             // Use a special lowercase filter for turkish, the stemmer expects it.
-            if (matchVersion.OnOrAfter(LuceneVersion.LUCENE_31) && name.Equals("Turkish"))
+            if (matchVersion.OnOrAfter(LuceneVersion.LUCENE_31) && name.Equals("Turkish", StringComparison.Ordinal))
             {
                 result = new TurkishLowerCaseFilter(result);
             }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs
index 725e498..46c78a9 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs
@@ -80,11 +80,11 @@ namespace Lucene.Net.Analysis.Synonym
             try
             {
                 string formatClass = format;
-                if (format == null || format.Equals("solr"))
+                if (format == null || format.Equals("solr", StringComparison.Ordinal))
                 {
                     formatClass = typeof(SolrSynonymParser).AssemblyQualifiedName;
                 }
-                else if (format.Equals("wordnet"))
+                else if (format.Equals("wordnet", StringComparison.Ordinal))
                 {
                     formatClass = typeof(WordnetSynonymParser).AssemblyQualifiedName;
                 }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs
index d08941c..457b729 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs
@@ -73,7 +73,7 @@ namespace Lucene.Net.Analysis.Synonym
             {
                 // check if you use the new optional arg "format". this makes no sense for the old one, 
                 // as its wired to solr's synonyms format only.
-                if (args.ContainsKey("format") && !args["format"].Equals("solr"))
+                if (args.ContainsKey("format") && !args["format"].Equals("solr", StringComparison.Ordinal))
                 {
                     throw new System.ArgumentException("You must specify luceneMatchVersion >= 3.4 to use alternate synonyms formats");
                 }
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/WordnetSynonymParser.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/WordnetSynonymParser.cs
index 604cbb8..76ebc5a 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/WordnetSynonymParser.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/WordnetSynonymParser.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Analysis.Synonym
                     lineNumber++;
                     string synSetID = line.Substring(2, 9);
 
-                    if (!synSetID.Equals(lastSynSetID))
+                    if (!synSetID.Equals(lastSynSetID, StringComparison.Ordinal))
                     {
                         AddInternal(synset, synsetSize);
                         synsetSize = 0;
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
index a0e4911..0b76dc5 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
@@ -334,7 +334,7 @@ namespace Lucene.Net.Analysis.Util
                 args.Remove(name);
                 try
                 {
-                    if (culture.Equals("invariant"))
+                    if (culture.Equals("invariant", StringComparison.Ordinal))
                     {
                         return CultureInfo.InvariantCulture;
                     }
diff --git a/src/Lucene.Net.Analysis.Common/Tartarus/Snowball/SnowballProgram.cs b/src/Lucene.Net.Analysis.Common/Tartarus/Snowball/SnowballProgram.cs
index 2dd5cd4..f2a66a0 100644
--- a/src/Lucene.Net.Analysis.Common/Tartarus/Snowball/SnowballProgram.cs
+++ b/src/Lucene.Net.Analysis.Common/Tartarus/Snowball/SnowballProgram.cs
@@ -417,7 +417,8 @@ namespace Lucene.Net.Tartarus.Snowball
                     try
                     {
                         object resobj = w.Method.Invoke(w.MethodObject, EMPTY_ARGS);
-                        res = resobj.ToString().Equals("true");
+                        // LUCENENET-542: Fixed case-sensitivity problem
+                        res = resobj.ToString().Equals("true", StringComparison.OrdinalIgnoreCase);
                     }
                     catch (TargetInvocationException /*e*/)
                     {
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2CharFilterFactory.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2CharFilterFactory.cs
index f6c9531..993ddf2 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2CharFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2CharFilterFactory.cs
@@ -67,7 +67,7 @@ namespace Lucene.Net.Analysis.Icu
             string name = Get(args, "name", "nfkc_cf");
             string mode = Get(args, "mode", new string[] { "compose", "decompose" }, "compose");
             Normalizer2 normalizer = Normalizer2.GetInstance
-                (null, name, "compose".Equals(mode) ? Normalizer2Mode.Compose : Normalizer2Mode.Decompose);
+                (null, name, "compose".Equals(mode, StringComparison.Ordinal) ? Normalizer2Mode.Compose : Normalizer2Mode.Decompose);
 
             string filter = Get(args, "filter");
             if (filter != null)
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2FilterFactory.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2FilterFactory.cs
index 4c3af3d..cf11e70 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2FilterFactory.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUNormalizer2FilterFactory.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Analysis.Icu
             string mode = Get(args, "mode", new string[] { "compose", "decompose" }, "compose");
 
             Normalizer2 normalizer = Normalizer2.GetInstance
-                (null, name, "compose".Equals(mode) ? Normalizer2Mode.Compose : Normalizer2Mode.Decompose);
+                (null, name, "compose".Equals(mode, StringComparison.Ordinal) ? Normalizer2Mode.Compose : Normalizer2Mode.Decompose);
 
             string filter = Get(args, "filter");
             if (filter != null)
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUTransformFilterFactory.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUTransformFilterFactory.cs
index 5eb4dd0..9627804 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUTransformFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUTransformFilterFactory.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.Analysis.Icu
         {
             string id = Require(args, "id");
             string direction = Get(args, "direction", new string[] { "forward", "reverse" }, "forward", false);
-            TransliterationDirection dir = "forward".Equals(direction) ? Transliterator.Forward : Transliterator.Reverse;
+            TransliterationDirection dir = "forward".Equals(direction, StringComparison.Ordinal) ? Transliterator.Forward : Transliterator.Reverse;
             transliterator = Transliterator.GetInstance(id, dir);
             if (args.Count != 0)
             {
diff --git a/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs b/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs
index bd5233b..bcbc81d 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.Ja.Dict;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Text;
@@ -133,7 +134,7 @@ namespace Lucene.Net.Analysis.Ja
                     string attrs;
                     string path;
                     bestPathMap.TryGetValue(fromNodeID, out path);
-                    if (toNodeID.Equals(path))
+                    if (toNodeID.Equals(path, StringComparison.Ordinal))
                     {
                         // This arc is on best path
                         attrs = " color=\"#40e050\" fontcolor=\"#40a050\" penwidth=3 fontsize=20";
diff --git a/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs b/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs
index c83b13d..4a81b34 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs
@@ -77,12 +77,12 @@ namespace Lucene.Net.Analysis.Ja.Util
             sb.Length = 0;
             sb.Append(CSVUtil.QuoteEscape(posData));
             sb.Append(',');
-            if (!"*".Equals(entry[8]))
+            if (!"*".Equals(entry[8], StringComparison.Ordinal))
             {
                 sb.Append(CSVUtil.QuoteEscape(entry[8]));
             }
             sb.Append(',');
-            if (!"*".Equals(entry[9]))
+            if (!"*".Equals(entry[9], StringComparison.Ordinal))
             {
                 sb.Append(CSVUtil.QuoteEscape(entry[9]));
             }
@@ -105,15 +105,15 @@ namespace Lucene.Net.Analysis.Ja.Util
             }
 
             int flags = 0;
-            if (!("*".Equals(baseForm) || baseForm.Equals(entry[0])))
+            if (!("*".Equals(baseForm, StringComparison.Ordinal) || baseForm.Equals(entry[0], StringComparison.Ordinal)))
             {
                 flags |= BinaryDictionary.HAS_BASEFORM;
             }
-            if (!reading.Equals(ToKatakana(entry[0])))
+            if (!reading.Equals(ToKatakana(entry[0]), StringComparison.Ordinal))
             {
                 flags |= BinaryDictionary.HAS_READING;
             }
-            if (!pronunciation.Equals(reading))
+            if (!pronunciation.Equals(reading, StringComparison.Ordinal))
             {
                 flags |= BinaryDictionary.HAS_PRONUNCIATION;
             }
@@ -128,7 +128,7 @@ namespace Lucene.Net.Analysis.Ja.Util
             }
 
             string existing = posDict[leftId];
-            Debug.Assert(existing == null || existing.Equals(fullPOSData));
+            Debug.Assert(existing == null || existing.Equals(fullPOSData, StringComparison.Ordinal));
             posDict[leftId] = fullPOSData;
 
             m_buffer.PutInt16((short)(leftId << 3 | flags));
diff --git a/src/Lucene.Net.Analysis.Phonetic/DoubleMetaphoneFilter.cs b/src/Lucene.Net.Analysis.Phonetic/DoubleMetaphoneFilter.cs
index 8ee37fa..0c3615a 100644
--- a/src/Lucene.Net.Analysis.Phonetic/DoubleMetaphoneFilter.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/DoubleMetaphoneFilter.cs
@@ -1,6 +1,7 @@
 // lucene version compatibility level: 4.8.1
 using Lucene.Net.Analysis.Phonetic.Language;
 using Lucene.Net.Analysis.TokenAttributes;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Analysis.Phonetic
@@ -77,7 +78,7 @@ namespace Lucene.Net.Analysis.Phonetic
                 // one token will be generated.
                 bool saveState = inject;
 
-                if (primaryPhoneticValue != null && primaryPhoneticValue.Length > 0 && !primaryPhoneticValue.Equals(v))
+                if (primaryPhoneticValue != null && primaryPhoneticValue.Length > 0 && !primaryPhoneticValue.Equals(v, StringComparison.Ordinal))
                 {
                     if (saveState)
                     {
@@ -90,8 +91,8 @@ namespace Lucene.Net.Analysis.Phonetic
                 }
 
                 if (alternatePhoneticValue != null && alternatePhoneticValue.Length > 0
-                        && !alternatePhoneticValue.Equals(primaryPhoneticValue)
-                        && !primaryPhoneticValue.Equals(v))
+                        && !alternatePhoneticValue.Equals(primaryPhoneticValue, StringComparison.Ordinal)
+                        && !primaryPhoneticValue.Equals(v, StringComparison.Ordinal))
                 {
                     if (saveState)
                     {
diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/AbstractCaverphone .cs b/src/Lucene.Net.Analysis.Phonetic/Language/AbstractCaverphone .cs
index b1db7fa..4510d6f 100644
--- a/src/Lucene.Net.Analysis.Phonetic/Language/AbstractCaverphone .cs	
+++ b/src/Lucene.Net.Analysis.Phonetic/Language/AbstractCaverphone .cs	
@@ -1,4 +1,6 @@
 // commons-codec version compatibility level: 1.9
+using System;
+
 namespace Lucene.Net.Analysis.Phonetic.Language
 {
     /*
@@ -72,7 +74,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language
         /// <returns><c>true</c> if the encodings of these strings are identical, <c>false</c> otherwise.</returns>
         public virtual bool IsEncodeEqual(string str1, string str2) 
         {
-            return this.Encode(str1).Equals(this.Encode(str2));
+            return this.Encode(str1).Equals(this.Encode(str2), StringComparison.Ordinal);
         }
     }
 }
diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/Bm/Lang.cs b/src/Lucene.Net.Analysis.Phonetic/Language/Bm/Lang.cs
index 4e3dcd4..3e31d7b 100644
--- a/src/Lucene.Net.Analysis.Phonetic/Language/Bm/Lang.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/Language/Bm/Lang.cs
@@ -200,7 +200,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language.Bm
 
                             Regex pattern = new Regex(parts[0], RegexOptions.Compiled);
                             string[] langs = TOKEN.Split(parts[1]).TrimEnd();
-                            bool accept = parts[2].Equals("true");
+                            bool accept = parts[2].Equals("true", StringComparison.Ordinal);
 
                             rules.Add(new LangRule(pattern, new HashSet<string>(langs), accept));
                         }
diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/Bm/PhoneticEngine.cs b/src/Lucene.Net.Analysis.Phonetic/Language/Bm/PhoneticEngine.cs
index 1288f6b..e79f024 100644
--- a/src/Lucene.Net.Analysis.Phonetic/Language/Bm/PhoneticEngine.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/Language/Bm/PhoneticEngine.cs
@@ -445,7 +445,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language.Bm
 
             if (this.nameType == NameType.GENERIC)
             {
-                if (input.Length >= 2 && input.Substring(0, 2 - 0).Equals("d'"))
+                if (input.Length >= 2 && input.Substring(0, 2 - 0).Equals("d'", StringComparison.Ordinal))
                 { // check for d'
                     string remainder = input.Substring(2);
                     string combined = "d" + remainder;
diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/Bm/Rule.cs b/src/Lucene.Net.Analysis.Phonetic/Language/Bm/Rule.cs
index 9e6e637..8f0567d 100644
--- a/src/Lucene.Net.Analysis.Phonetic/Language/Bm/Rule.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/Language/Bm/Rule.cs
@@ -895,7 +895,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language.Bm
 
             // evaluate the pattern, left context and right context
             // fail early if any of the evaluations is not successful
-            if (!input.Substring(i, (ipl - i)).Equals(this.pattern))
+            if (!input.Substring(i, (ipl - i)).Equals(this.pattern, StringComparison.Ordinal))
             {
                 return false;
             }
@@ -933,7 +933,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language.Bm
 
             // evaluate the pattern, left context and right context
             // fail early if any of the evaluations is not successful
-            if (!input.ToString(i, (ipl - i)).Equals(this.pattern))
+            if (!input.ToString(i, (ipl - i)).Equals(this.pattern, StringComparison.Ordinal))
             {
                 return false;
             }
diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/ColognePhonetic.cs b/src/Lucene.Net.Analysis.Phonetic/Language/ColognePhonetic.cs
index 944267d..d2cf78e 100644
--- a/src/Lucene.Net.Analysis.Phonetic/Language/ColognePhonetic.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/Language/ColognePhonetic.cs
@@ -1,4 +1,5 @@
 // commons-codec version compatibility level: 1.9
+using System;
 using System.Globalization;
 
 namespace Lucene.Net.Analysis.Phonetic.Language
@@ -469,7 +470,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language
 
         public virtual bool IsEncodeEqual(string text1, string text2)
         {
-            return GetColognePhonetic(text1).Equals(GetColognePhonetic(text2));
+            return GetColognePhonetic(text1).Equals(GetColognePhonetic(text2), StringComparison.Ordinal);
         }
 
         /// <summary>
diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/DaitchMokotoffSoundex.cs b/src/Lucene.Net.Analysis.Phonetic/Language/DaitchMokotoffSoundex.cs
index cf26e19..c0de1eb 100644
--- a/src/Lucene.Net.Analysis.Phonetic/Language/DaitchMokotoffSoundex.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/Language/DaitchMokotoffSoundex.cs
@@ -101,7 +101,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language
                     return false;
                 }
 
-                return ToString().Equals(((Branch)other).ToString());
+                return ToString().Equals(((Branch)other).ToString(), StringComparison.Ordinal);
             }
 
             /// <summary>
diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/DoubleMetaphone.cs b/src/Lucene.Net.Analysis.Phonetic/Language/DoubleMetaphone.cs
index 2d239be..8f023de 100644
--- a/src/Lucene.Net.Analysis.Phonetic/Language/DoubleMetaphone.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/Language/DoubleMetaphone.cs
@@ -244,7 +244,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language
         /// <returns><c>true</c> if the encoded <see cref="string"/>s are equal; <c>false</c> otherwise.</returns>
         public virtual bool IsDoubleMetaphoneEqual(string value1, string value2, bool alternate)
         {
-            return GetDoubleMetaphone(value1, alternate).Equals(GetDoubleMetaphone(value2, alternate));
+            return GetDoubleMetaphone(value1, alternate).Equals(GetDoubleMetaphone(value2, alternate), StringComparison.Ordinal);
         }
 
         /// <summary>
@@ -1163,7 +1163,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language
 
                 foreach (string element in criteria)
                 {
-                    if (target.Equals(element))
+                    if (target.Equals(element, StringComparison.Ordinal))
                     {
                         result = true;
                         break;
diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/Metaphone.cs b/src/Lucene.Net.Analysis.Phonetic/Language/Metaphone.cs
index dd3038f..31cb297 100644
--- a/src/Lucene.Net.Analysis.Phonetic/Language/Metaphone.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/Language/Metaphone.cs
@@ -1,4 +1,5 @@
 // commons-codec version compatibility level: 1.9
+using System;
 using System.Globalization;
 using System.Text;
 
@@ -429,7 +430,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language
                 index + test.Length - 1 < sb.Length)
             {
                 string substring = sb.ToString(index, test.Length);
-                matches = substring.Equals(test);
+                matches = substring.Equals(test, StringComparison.Ordinal);
             }
             return matches;
         }
@@ -479,7 +480,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language
         /// <returns><c>true</c> if the metaphones of these strings are identical, <c>false</c> otherwise.</returns>
         public virtual bool IsMetaphoneEqual(string str1, string str2)
         {
-            return GetMetaphone(str1).Equals(GetMetaphone(str2));
+            return GetMetaphone(str1).Equals(GetMetaphone(str2), StringComparison.Ordinal);
         }
 
         /// <summary>
diff --git a/src/Lucene.Net.Analysis.Phonetic/PhoneticFilter.cs b/src/Lucene.Net.Analysis.Phonetic/PhoneticFilter.cs
index c5d2886..bffc0e5 100644
--- a/src/Lucene.Net.Analysis.Phonetic/PhoneticFilter.cs
+++ b/src/Lucene.Net.Analysis.Phonetic/PhoneticFilter.cs
@@ -71,7 +71,7 @@ namespace Lucene.Net.Analysis.Phonetic
             try
             {
                 string v = encoder.Encode(value);
-                if (v.Length > 0 && !value.Equals(v))
+                if (v.Length > 0 && !value.Equals(v, StringComparison.Ordinal))
                 {
                     phonetic = v;
                 }
diff --git a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs
index 0665b3f..9dd95ed 100644
--- a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs
+++ b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs
@@ -120,7 +120,7 @@ namespace Egothor.Stemmer
             // command line argument overrides environment variable or default, if supplied
             for (int i = 1; i < args.Length; i++)
             {
-                if ("-e".Equals(args[i]) || "--encoding".Equals(args[i]))
+                if ("-e".Equals(args[i], StringComparison.Ordinal) || "--encoding".Equals(args[i], StringComparison.Ordinal))
                 {
                     charset = args[i];
                 }
@@ -166,7 +166,7 @@ namespace Egothor.Stemmer
                             while (st.HasMoreTokens())
                             {
                                 string token = st.NextToken();
-                                if (token.Equals(stem) == false)
+                                if (token.Equals(stem, StringComparison.Ordinal) == false)
                                 {
                                     trie.Add(token, diff.Exec(token, stem));
                                     words++;
diff --git a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs
index 54218dc..85a66c6 100644
--- a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs
+++ b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs
@@ -107,7 +107,7 @@ namespace Egothor.Stemmer
             // command line argument overrides environment variable or default, if supplied
             for (int i = 1; i < args.Length; i++)
             {
-                if ("-e".Equals(args[i]) || "--encoding".Equals(args[i]))
+                if ("-e".Equals(args[i], StringComparison.Ordinal) || "--encoding".Equals(args[i], StringComparison.Ordinal))
                 {
                     charset = args[i];
                 }
@@ -136,7 +136,7 @@ namespace Egothor.Stemmer
                             while (st.HasMoreTokens())
                             {
                                 string token = st.NextToken();
-                                if (token.Equals(stem) == false)
+                                if (token.Equals(stem, StringComparison.Ordinal) == false)
                                 {
                                     Console.WriteLine(stem + " " + diff.Exec(token, stem));
                                 }
diff --git a/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs b/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs
index a8efda0..9d62e47 100644
--- a/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs
@@ -139,7 +139,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks
                     throw new Exception("unable to instantiate class '" + mergeScheduler + "' as merge scheduler", e);
                 }
 
-                if (mergeScheduler.Equals("Lucene.Net.Index.ConcurrentMergeScheduler"))
+                if (mergeScheduler.Equals("Lucene.Net.Index.ConcurrentMergeScheduler", StringComparison.Ordinal))
                 {
 #if FEATURE_CONCURRENTMERGESCHEDULER
                     ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)iwConf.MergeScheduler;
diff --git a/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs b/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs
index d31a481..8e3fccf 100644
--- a/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs
@@ -120,7 +120,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks
             // init sufficient fields
             sufficientFields = new bool[fieldsToWrite.Length];
             string suff = config.Get("sufficient.fields", DEFAULT_SUFFICIENT_FIELDS);
-            if (",".Equals(suff))
+            if (",".Equals(suff, StringComparison.Ordinal))
             {
                 checkSufficientFields = false;
             }
diff --git a/src/Lucene.Net.Benchmark/Support/Sax/Ext/Attributes2Impl.cs b/src/Lucene.Net.Benchmark/Support/Sax/Ext/Attributes2Impl.cs
index 062e3fd..8c32a04 100644
--- a/src/Lucene.Net.Benchmark/Support/Sax/Ext/Attributes2Impl.cs
+++ b/src/Lucene.Net.Benchmark/Support/Sax/Ext/Attributes2Impl.cs
@@ -188,7 +188,7 @@ namespace Sax.Ext
             } else {
                 for (int i = 0; i < length; i++)
                 {
-                    declared[i] = !"CDATA".Equals(atts.GetType(i));
+                    declared[i] = !"CDATA".Equals(atts.GetType(i), StringComparison.Ordinal);
                     specified[i] = true;
                 }
             }
@@ -225,7 +225,7 @@ namespace Sax.Ext
             }
 
             specified[length - 1] = true;
-            declared[length - 1] = !"CDATA".Equals(type);
+            declared[length - 1] = !"CDATA".Equals(type, StringComparison.Ordinal);
         }
 
         // javadoc entirely from superclass
diff --git a/src/Lucene.Net.Benchmark/Support/Sax/Helpers/NamespaceSupport.cs b/src/Lucene.Net.Benchmark/Support/Sax/Helpers/NamespaceSupport.cs
index 3651a2d..c4014a0 100644
--- a/src/Lucene.Net.Benchmark/Support/Sax/Helpers/NamespaceSupport.cs
+++ b/src/Lucene.Net.Benchmark/Support/Sax/Helpers/NamespaceSupport.cs
@@ -251,7 +251,7 @@ namespace Sax.Helpers
         /// <seealso cref="GetPrefix(string)" />
         public bool DeclarePrefix(string prefix, string uri)
         {
-            if (prefix.Equals("xml") || prefix.Equals("xmlns"))
+            if (prefix.Equals("xml", StringComparison.Ordinal) || prefix.Equals("xmlns", StringComparison.Ordinal))
             {
                 return false;
             }
@@ -428,7 +428,7 @@ namespace Sax.Helpers
             while (allPrefixes.MoveNext())
             {
                 var prefix = (string)allPrefixes.Current;
-                if (uri.Equals(GetUri(prefix)))
+                if (uri.Equals(GetUri(prefix), StringComparison.Ordinal))
                 {
                     prefixes.Add(prefix);
                 }
@@ -593,9 +593,9 @@ namespace Sax.Helpers
 
                 prefix = prefix.Intern();
                 uri = uri.Intern();
-                if ("".Equals(prefix))
+                if ("".Equals(prefix, StringComparison.Ordinal))
                 {
-                    if ("".Equals(uri))
+                    if ("".Equals(uri, StringComparison.Ordinal))
                     {
                         defaultNs = null;
                     }
@@ -687,7 +687,7 @@ namespace Sax.Helpers
                     string prefix = qName.Substring(0, index);
                     string local = qName.Substring(index + 1);
                     string uri = null;
-                    if ("".Equals(prefix))
+                    if ("".Equals(prefix, StringComparison.Ordinal))
                     {
                         uri = defaultNs;
                     }
@@ -695,7 +695,7 @@ namespace Sax.Helpers
                     {
                         uri = (string)prefixTable[prefix];
                     }
-                    if (uri == null || (!isAttribute && "xmlns".Equals(prefix)))
+                    if (uri == null || (!isAttribute && "xmlns".Equals(prefix, StringComparison.Ordinal)))
                     {
                         return null;
                     }
@@ -717,7 +717,7 @@ namespace Sax.Helpers
             /// <seealso cref="NamespaceSupport.GetUri(string)"/>
             internal string GetURI(string prefix)
             {
-                if ("".Equals(prefix))
+                if ("".Equals(prefix, StringComparison.Ordinal))
                 {
                     return defaultNs;
                 }
diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/Element.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/Element.cs
index 30aeb0b..edd3452 100644
--- a/src/Lucene.Net.Benchmark/Support/TagSoup/Element.cs
+++ b/src/Lucene.Net.Benchmark/Support/TagSoup/Element.cs
@@ -12,6 +12,7 @@
 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 using Sax.Helpers;
+using System;
 
 namespace TagSoup
 {
@@ -178,7 +179,7 @@ namespace TagSoup
         {
             for (int i = _atts.Length - 1; i >= 0; i--)
             {
-                if (_atts.GetType(i).Equals("ID") || _atts.GetQName(i).Equals("name"))
+                if (_atts.GetType(i).Equals("ID", StringComparison.Ordinal) || _atts.GetQName(i).Equals("name", StringComparison.Ordinal))
                 {
                     _atts.RemoveAttribute(i);
                 }
diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs
index 0827ad6..92bb5a1 100644
--- a/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs
+++ b/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs
@@ -140,7 +140,7 @@ namespace TagSoup
                 return attribute ? "" : schema.Uri;
             }
             string prefix = name.Substring(0, colon);
-            if (prefix.Equals("xml"))
+            if (prefix.Equals("xml", StringComparison.Ordinal))
             {
                 return "http://www.w3.org/XML/1998/namespace";
             }
@@ -184,7 +184,7 @@ namespace TagSoup
         /// <param name="value">The value of the attribute</param>
         public virtual void SetAttribute(Attributes atts, string name, string type, string value)
         {
-            if (name.Equals("xmlns") || name.StartsWith("xmlns:"))
+            if (name.Equals("xmlns", StringComparison.Ordinal) || name.StartsWith("xmlns:", StringComparison.Ordinal))
             {
                 return;
             }
@@ -199,7 +199,7 @@ namespace TagSoup
                 {
                     type = "CDATA";
                 }
-                if (!type.Equals("CDATA"))
+                if (!type.Equals("CDATA", StringComparison.Ordinal))
                 {
                     value = Normalize(value);
                 }
@@ -211,7 +211,7 @@ namespace TagSoup
                 {
                     type = atts.GetType(i);
                 }
-                if (!type.Equals("CDATA"))
+                if (!type.Equals("CDATA", StringComparison.Ordinal))
                 {
                     value = Normalize(value);
                 }
diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/PYXScanner.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/PYXScanner.cs
index 711d46a..18f6d5e 100644
--- a/src/Lucene.Net.Benchmark/Support/TagSoup/PYXScanner.cs
+++ b/src/Lucene.Net.Benchmark/Support/TagSoup/PYXScanner.cs
@@ -27,6 +27,7 @@
 // 
 // PYX Scanner
 
+using System;
 using System.IO;
 
 namespace TagSoup
@@ -94,7 +95,7 @@ namespace TagSoup
                             h.STagC(buff, 0, 0);
                             instag = false;
                         }
-                        if (s.Equals("-\\n"))
+                        if (s.Equals("-\\n", StringComparison.Ordinal))
                         {
                             buff[0] = '\n';
                             h.PCDATA(buff, 0, 1);
diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs
index f18990f..2f74cbd 100644
--- a/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs
+++ b/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs
@@ -296,39 +296,39 @@ namespace TagSoup
             }
             features[name] = value;
 
-            if (name.Equals(NAMESPACES_FEATURE))
+            if (name.Equals(NAMESPACES_FEATURE, StringComparison.Ordinal))
             {
                 namespaces = value;
             }
-            else if (name.Equals(IGNORE_BOGONS_FEATURE))
+            else if (name.Equals(IGNORE_BOGONS_FEATURE, StringComparison.Ordinal))
             {
                 ignoreBogons = value;
             }
-            else if (name.Equals(BOGONS_EMPTY_FEATURE))
+            else if (name.Equals(BOGONS_EMPTY_FEATURE, StringComparison.Ordinal))
             {
                 bogonsEmpty = value;
             }
-            else if (name.Equals(ROOT_BOGONS_FEATURE))
+            else if (name.Equals(ROOT_BOGONS_FEATURE, StringComparison.Ordinal))
             {
                 rootBogons = value;
             }
-            else if (name.Equals(DEFAULT_ATTRIBUTES_FEATURE))
+            else if (name.Equals(DEFAULT_ATTRIBUTES_FEATURE, StringComparison.Ordinal))
             {
                 defaultAttributes = value;
             }
-            else if (name.Equals(TRANSLATE_COLONS_FEATURE))
+            else if (name.Equals(TRANSLATE_COLONS_FEATURE, StringComparison.Ordinal))
             {
                 translateColons = value;
             }
-            else if (name.Equals(RESTART_ELEMENTS_FEATURE))
+            else if (name.Equals(RESTART_ELEMENTS_FEATURE, StringComparison.Ordinal))
             {
                 restartElements = value;
             }
-            else if (name.Equals(IGNORABLE_WHITESPACE_FEATURE))
+            else if (name.Equals(IGNORABLE_WHITESPACE_FEATURE, StringComparison.Ordinal))
             {
                 ignorableWhitespace = value;
             }
-            else if (name.Equals(CDATA_ELEMENTS_FEATURE))
+            else if (name.Equals(CDATA_ELEMENTS_FEATURE, StringComparison.Ordinal))
             {
                 cDataElements = value;
             }
@@ -336,19 +336,19 @@ namespace TagSoup
 
         public virtual object GetProperty(string name)
         {
-            if (name.Equals(LEXICAL_HANDLER_PROPERTY))
+            if (name.Equals(LEXICAL_HANDLER_PROPERTY, StringComparison.Ordinal))
             {
                 return theLexicalHandler == this ? null : theLexicalHandler;
             }
-            if (name.Equals(SCANNER_PROPERTY))
+            if (name.Equals(SCANNER_PROPERTY, StringComparison.Ordinal))
             {
                 return theScanner;
             }
-            if (name.Equals(SCHEMA_PROPERTY))
+            if (name.Equals(SCHEMA_PROPERTY, StringComparison.Ordinal))
             {
                 return theSchema;
             }
-            if (name.Equals(AUTO_DETECTOR_PROPERTY))
+            if (name.Equals(AUTO_DETECTOR_PROPERTY, StringComparison.Ordinal))
             {
                 return theAutoDetector;
             }
@@ -357,7 +357,7 @@ namespace TagSoup
 
         public virtual void SetProperty(string name, object value)
         {
-            if (name.Equals(LEXICAL_HANDLER_PROPERTY))
+            if (name.Equals(LEXICAL_HANDLER_PROPERTY, StringComparison.Ordinal))
             {
                 if (value == null)
                 {
@@ -376,7 +376,7 @@ namespace TagSoup
                     }
                 }
             }
-            else if (name.Equals(SCANNER_PROPERTY))
+            else if (name.Equals(SCANNER_PROPERTY, StringComparison.Ordinal))
             {
                 var scanner = value as IScanner;
                 if (scanner != null)
@@ -388,7 +388,7 @@ namespace TagSoup
                     throw new SAXNotSupportedException("Your scanner is not a IScanner");
                 }
             }
-            else if (name.Equals(SCHEMA_PROPERTY))
+            else if (name.Equals(SCHEMA_PROPERTY, StringComparison.Ordinal))
             {
                 var schema = value as Schema;
                 if (schema != null)
@@ -400,7 +400,7 @@ namespace TagSoup
                     throw new SAXNotSupportedException("Your schema is not a Schema");
                 }
             }
-            else if (name.Equals(AUTO_DETECTOR_PROPERTY))
+            else if (name.Equals(AUTO_DETECTOR_PROPERTY, StringComparison.Ordinal))
             {
                 var detector = value as IAutoDetector;
                 if (detector != null)
@@ -453,7 +453,7 @@ namespace TagSoup
             {
                 theContentHandler.SetDocumentLocator(locator);
             }
-            if (!(theSchema.Uri.Equals("")))
+            if (!(theSchema.Uri.Equals("", StringComparison.Ordinal)))
             {
                 theContentHandler.StartPrefixMapping(theSchema.Prefix, theSchema.Uri);
             }
@@ -719,7 +719,7 @@ namespace TagSoup
             {
                 Pop();
             }
-            if (!(theSchema.Uri.Equals("")))
+            if (!(theSchema.Uri.Equals("", StringComparison.Ordinal)))
             {
                 theContentHandler.EndPrefixMapping(theSchema.Prefix);
             }
@@ -794,7 +794,7 @@ namespace TagSoup
             bool inNoforce = false;
             for (sp = theStack; sp != null; sp = sp.Next)
             {
-                if (sp.Name.Equals(name))
+                if (sp.Name.Equals(name, StringComparison.Ordinal))
                 {
                     break;
                 }
@@ -981,7 +981,7 @@ namespace TagSoup
         private bool Foreign(string prefix, string ns)
         {
             //		System.err.print("%% Testing " + prefix + " and " + namespace + " for foreignness -- ");
-            bool foreign = !(prefix.Equals("") || ns.Equals("") || ns.Equals(theSchema.Uri));
+            bool foreign = !(prefix.Equals("", StringComparison.Ordinal) || ns.Equals("", StringComparison.Ordinal) || ns.Equals(theSchema.Uri, StringComparison.Ordinal));
             //		System.err.println(foreign);
             return foreign;
         }
@@ -1015,11 +1015,11 @@ namespace TagSoup
                 if (v.Length > 1)
                 {
                     name = v[1];
-                    if (v.Length > 3 && "SYSTEM".Equals(v[2]))
+                    if (v.Length > 3 && "SYSTEM".Equals(v[2], StringComparison.Ordinal))
                     {
                         systemid = v[3];
                     }
-                    else if (v.Length > 3 && "PUBLIC".Equals(v[2]))
+                    else if (v.Length > 3 && "PUBLIC".Equals(v[2], StringComparison.Ordinal))
                     {
                         publicid = v[3];
                         if (v.Length > 4)
@@ -1356,7 +1356,7 @@ namespace TagSoup
             while (e != null)
             {
                 Element nexte = e.Next;
-                if (!e.Name.Equals("<pcdata>"))
+                if (!e.Name.Equals("<pcdata>", StringComparison.Ordinal))
                 {
                     Push(e);
                 }
diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/XMLWriter.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/XMLWriter.cs
index 09d3edd..f1f20fd 100644
--- a/src/Lucene.Net.Benchmark/Support/TagSoup/XMLWriter.cs
+++ b/src/Lucene.Net.Benchmark/Support/TagSoup/XMLWriter.cs
@@ -324,7 +324,7 @@ namespace TagSoup
             {
                 publicid = overridePublic;
             }
-            if (!(publicid == null || "".Equals(publicid)))
+            if (!(publicid == null || "".Equals(publicid, StringComparison.Ordinal)))
             {
                 char pubquote = (publicid.IndexOf('"') != -1) ? '\'' : '"';
                 Write(" PUBLIC ");
@@ -530,7 +530,7 @@ namespace TagSoup
         public override void StartDocument()
         {
             Reset();
-            if (!("yes".Equals(outputProperties[OMIT_XML_DECLARATION] ?? "no")))
+            if (!("yes".Equals(outputProperties[OMIT_XML_DECLARATION] ?? "no", StringComparison.Ordinal)))
             {
                 Write("<?xml");
                 if (version == null)
@@ -632,7 +632,7 @@ namespace TagSoup
             WriteNSDecls();
             Write('>');
             //	System.out.println("%%%% startElement [" + qName + "] htmlMode = " + htmlMode);
-            if (htmlMode && (qName.Equals("script") || qName.Equals("style")))
+            if (htmlMode && (qName.Equals("script", StringComparison.Ordinal) || qName.Equals("style", StringComparison.Ordinal)))
             {
                 cdataElement = true;
                 //		System.out.println("%%%% CDATA element");
@@ -667,11 +667,11 @@ namespace TagSoup
         public override void EndElement(string uri, string localName, string qName)
         {
             if (
-              !(htmlMode && (uri.Equals("http://www.w3.org/1999/xhtml") || uri.Equals(""))
-                && (qName.Equals("area") || qName.Equals("base") || qName.Equals("basefont") || qName.Equals("br")
-                    || qName.Equals("col") || qName.Equals("frame") || qName.Equals("hr") || qName.Equals("img")
-                    || qName.Equals("input") || qName.Equals("isindex") || qName.Equals("link") || qName.Equals("meta")
-                    || qName.Equals("param"))))
+              !(htmlMode && (uri.Equals("http://www.w3.org/1999/xhtml", StringComparison.Ordinal) || uri.Equals("", StringComparison.Ordinal))
+                && (qName.Equals("area", StringComparison.Ordinal) || qName.Equals("base", StringComparison.Ordinal) || qName.Equals("basefont", StringComparison.Ordinal) || qName.Equals("br", StringComparison.Ordinal)
+                    || qName.Equals("col", StringComparison.Ordinal) || qName.Equals("frame", StringComparison.Ordinal) || qName.Equals("hr", StringComparison.Ordinal) || qName.Equals("img", StringComparison.Ordinal)
+                    || qName.Equals("input", StringComparison.Ordinal) || qName.Equals("isindex", StringComparison.Ordinal) || qName.Equals("link", StringComparison.Ordinal) || qName.Equals("meta", StringComparison.Ordinal)
+                    || qName.Equals("param", StringComparison.Ordinal))))
             {
                 Write("</");
                 WriteName(uri, localName, qName, true);
@@ -1152,7 +1152,7 @@ namespace TagSoup
         private string DoPrefix(string uri, string qName, bool isElement)
         {
             string defaultNS = nsSupport.GetUri("");
-            if ("".Equals(uri))
+            if ("".Equals(uri, StringComparison.Ordinal))
             {
                 if (isElement && defaultNS != null)
                 {
@@ -1161,7 +1161,7 @@ namespace TagSoup
                 return null;
             }
             string prefix;
-            if (isElement && defaultNS != null && uri.Equals(defaultNS))
+            if (isElement && defaultNS != null && uri.Equals(defaultNS, StringComparison.Ordinal))
             {
                 prefix = "";
             }
@@ -1175,7 +1175,7 @@ namespace TagSoup
             }
             bool containsPrefix = doneDeclTable.ContainsKey(uri);
             prefix = (string)(containsPrefix ? doneDeclTable[uri] : null);
-            if (containsPrefix && ((!isElement || defaultNS != null) && "".Equals(prefix) || nsSupport.GetUri(prefix) != null))
+            if (containsPrefix && ((!isElement || defaultNS != null) && "".Equals(prefix, StringComparison.Ordinal) || nsSupport.GetUri(prefix) != null))
             {
                 prefix = null;
             }
@@ -1184,12 +1184,12 @@ namespace TagSoup
                 containsPrefix = prefixTable.ContainsKey(uri);
                 prefix = (string)(containsPrefix ? prefixTable[uri] : null);
                 if (containsPrefix
-                    && ((!isElement || defaultNS != null) && "".Equals(prefix) || nsSupport.GetUri(prefix) != null))
+                    && ((!isElement || defaultNS != null) && "".Equals(prefix, StringComparison.Ordinal) || nsSupport.GetUri(prefix) != null))
                 {
                     prefix = null;
                 }
             }
-            if (prefix == null && qName != null && !"".Equals(qName))
+            if (prefix == null && qName != null && !"".Equals(qName, StringComparison.Ordinal))
             {
                 int i = qName.IndexOf(':');
                 if (i == -1)
@@ -1297,13 +1297,13 @@ namespace TagSoup
                     name = qName.Substring(i + 1, qName.Length);
                 }
             }
-            if (!name.Equals(value))
+            if (!name.Equals(value, StringComparison.Ordinal))
             {
                 return false;
             }
             for (int j = 0; j < _bools.Length; j++)
             {
-                if (name.Equals(_bools[j]))
+                if (name.Equals(_bools[j], StringComparison.Ordinal))
                 {
                     return true;
                 }
@@ -1393,7 +1393,7 @@ namespace TagSoup
                 }
                 char[] ch = uri.ToCharArray();
                 Write(' ');
-                if ("".Equals(prefix))
+                if ("".Equals(prefix, StringComparison.Ordinal))
                 {
                     Write("xmlns=\"");
                 }
@@ -1432,12 +1432,12 @@ namespace TagSoup
         private void WriteName(string uri, string localName, string qName, bool isElement)
         {
             string prefix = DoPrefix(uri, qName, isElement);
-            if (prefix != null && !"".Equals(prefix))
+            if (prefix != null && !"".Equals(prefix, StringComparison.Ordinal))
             {
                 Write(prefix);
                 Write(':');
             }
-            if (localName != null && !"".Equals(localName))
+            if (localName != null && !"".Equals(localName, StringComparison.Ordinal))
             {
                 Write(localName);
             }
@@ -1480,31 +1480,31 @@ namespace TagSoup
         {
             outputProperties[key] = value;
             //	System.out.println("%%%% key = [" + key + "] value = [" + value +"]");
-            if (key.Equals(ENCODING))
+            if (key.Equals(ENCODING, StringComparison.Ordinal))
             {
                 outputEncoding = value;
                 unicodeMode = value.Substring(0, 3).Equals("utf", StringComparison.OrdinalIgnoreCase);
                 //                System.out.println("%%%% unicodeMode = " + unicodeMode);
             }
-            else if (key.Equals(METHOD))
+            else if (key.Equals(METHOD, StringComparison.Ordinal))
             {
-                htmlMode = value.Equals("html");
+                htmlMode = value.Equals("html", StringComparison.Ordinal);
             }
-            else if (key.Equals(DOCTYPE_PUBLIC))
+            else if (key.Equals(DOCTYPE_PUBLIC, StringComparison.Ordinal))
             {
                 overridePublic = value;
                 forceDTD = true;
             }
-            else if (key.Equals(DOCTYPE_SYSTEM))
+            else if (key.Equals(DOCTYPE_SYSTEM, StringComparison.Ordinal))
             {
                 overrideSystem = value;
                 forceDTD = true;
             }
-            else if (key.Equals(VERSION))
+            else if (key.Equals(VERSION, StringComparison.Ordinal))
             {
                 version = value;
             }
-            else if (key.Equals(STANDALONE))
+            else if (key.Equals(STANDALONE, StringComparison.Ordinal))
             {
                 standalone = value;
             }
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs
index dc74dbf..ea658b0 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs
@@ -160,7 +160,7 @@ namespace Lucene.Net.Codecs.SimpleText
 
         public virtual Index.DocValuesType DocValuesType(string dvType)
         {
-            return "false".Equals(dvType) ? Index.DocValuesType.NONE : (Index.DocValuesType)Enum.Parse(typeof(Index.DocValuesType), dvType, true);
+            return "false".Equals(dvType, StringComparison.Ordinal) ? Index.DocValuesType.NONE : (Index.DocValuesType)Enum.Parse(typeof(Index.DocValuesType), dvType, true);
         }
 
         private string ReadString(int offset, BytesRef scratch)
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
index 43ab450..e98a5a6 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
@@ -1,4 +1,5 @@
-using System.Globalization;
+using System;
+using System.Globalization;
 
 namespace Lucene.Net.Codecs.SimpleText
 {
@@ -110,7 +111,7 @@ namespace Lucene.Net.Codecs.SimpleText
             }
             var actualChecksum =
                 (new BytesRef(scratch.Bytes, CHECKSUM.Length, scratch.Length - CHECKSUM.Length)).Utf8ToString();
-            if (!expectedChecksum.Equals(actualChecksum))
+            if (!expectedChecksum.Equals(actualChecksum, StringComparison.Ordinal))
             {
                 throw new CorruptIndexException("SimpleText checksum failure: " + actualChecksum + " != " +
                                                 expectedChecksum + " (resource=" + input + ")");
diff --git a/src/Lucene.Net.Demo/IndexFiles.cs b/src/Lucene.Net.Demo/IndexFiles.cs
index 048821d..1abf35c 100644
--- a/src/Lucene.Net.Demo/IndexFiles.cs
+++ b/src/Lucene.Net.Demo/IndexFiles.cs
@@ -67,7 +67,7 @@ namespace Lucene.Net.Demo
 
             for (int i = 0; i < args.Length; i++)
             {
-                if ("-u".Equals(args[i]) || "--update".Equals(args[i]))
+                if ("-u".Equals(args[i], StringComparison.Ordinal) || "--update".Equals(args[i], StringComparison.Ordinal))
                 {
                     create = false;
                 }
diff --git a/src/Lucene.Net.Demo/SearchFiles.cs b/src/Lucene.Net.Demo/SearchFiles.cs
index 412a744..29106ba 100644
--- a/src/Lucene.Net.Demo/SearchFiles.cs
+++ b/src/Lucene.Net.Demo/SearchFiles.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Demo
                 "Use no --query or --queries-file option for interactive mode.\n\n" +
                 "See http://lucene.apache.org/core/4_8_0/demo/ for details.";
             if (args.Length < 1 || args.Length > 0 && 
-                ("?".Equals(args[0]) || "-h".Equals(args[0]) || "--help".Equals(args[0])))
+                ("?".Equals(args[0], StringComparison.Ordinal) || "-h".Equals(args[0], StringComparison.Ordinal) || "--help".Equals(args[0], StringComparison.Ordinal)))
             {
                 Console.WriteLine(usage);
                 Environment.Exit(0);
@@ -72,31 +72,31 @@ namespace Lucene.Net.Demo
 
             for (int i = 0; i < args.Length; i++)
             {
-                if ("-f".Equals(args[i]) || "-field".Equals(args[i]))
+                if ("-f".Equals(args[i], StringComparison.Ordinal) || "-field".Equals(args[i], StringComparison.Ordinal))
                 {
                     field = args[i + 1];
                     i++;
                 }
-                else if ("-qf".Equals(args[i]) || "--queries-file".Equals(args[i]))
+                else if ("-qf".Equals(args[i], StringComparison.Ordinal) || "--queries-file".Equals(args[i], StringComparison.Ordinal))
                 {
                     queries = args[i + 1];
                     i++;
                 }
-                else if ("-q".Equals(args[i]) || "--query".Equals(args[i]))
+                else if ("-q".Equals(args[i], StringComparison.Ordinal) || "--query".Equals(args[i], StringComparison.Ordinal))
                 {
                     queryString = args[i + 1];
                     i++;
                 }
-                else if ("-r".Equals(args[i]) || "--repeat".Equals(args[i]))
+                else if ("-r".Equals(args[i], StringComparison.Ordinal) || "--repeat".Equals(args[i], StringComparison.Ordinal))
                 {
                     repeat = int.Parse(args[i + 1], CultureInfo.InvariantCulture);
                     i++;
                 }
-                else if ("--raw".Equals(args[i]))
+                else if ("--raw".Equals(args[i], StringComparison.Ordinal))
                 {
                     raw = true;
                 }
-                else if ("-p".Equals(args[i]) || "--paging".Equals(args[i]))
+                else if ("-p".Equals(args[i], StringComparison.Ordinal) || "--paging".Equals(args[i], StringComparison.Ordinal))
                 {
                     hitsPerPage = int.Parse(args[i + 1], CultureInfo.InvariantCulture);
                     if (hitsPerPage <= 0)
diff --git a/src/Lucene.Net.Facet/FacetsConfig.cs b/src/Lucene.Net.Facet/FacetsConfig.cs
index abbaf4b..d800319 100644
--- a/src/Lucene.Net.Facet/FacetsConfig.cs
+++ b/src/Lucene.Net.Facet/FacetsConfig.cs
@@ -375,7 +375,7 @@ namespace Lucene.Net.Facet
                     {
                         assocDimTypes[indexFieldName] = type;
                     }
-                    else if (!curType.Equals(type))
+                    else if (!curType.Equals(type, StringComparison.Ordinal))
                     {
                         throw new System.ArgumentException("mixing incompatible types of AssocationFacetField (" + curType + " and " + type + ") in indexed field \"" + indexFieldName + "\"; use FacetsConfig to change the indexFieldName for each dimension");
                     }
diff --git a/src/Lucene.Net.Facet/LabelAndValue.cs b/src/Lucene.Net.Facet/LabelAndValue.cs
index b5719bf..8c7eb4c 100644
--- a/src/Lucene.Net.Facet/LabelAndValue.cs
+++ b/src/Lucene.Net.Facet/LabelAndValue.cs
@@ -76,7 +76,7 @@ namespace Lucene.Net.Facet
                 return false;
             }
             LabelAndValue _other = (LabelAndValue)other;
-            return Label.Equals(_other.Label) && Value.Equals(_other.Value);
+            return Label.Equals(_other.Label, StringComparison.Ordinal) && Value.Equals(_other.Value);
         }
 
         public override int GetHashCode()
diff --git a/src/Lucene.Net.Facet/Range/RangeFacetCounts.cs b/src/Lucene.Net.Facet/Range/RangeFacetCounts.cs
index b10591c..02b08c0 100644
--- a/src/Lucene.Net.Facet/Range/RangeFacetCounts.cs
+++ b/src/Lucene.Net.Facet/Range/RangeFacetCounts.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 
 namespace Lucene.Net.Facet.Range
 {
@@ -64,7 +65,7 @@ namespace Lucene.Net.Facet.Range
 
         public override FacetResult GetTopChildren(int topN, string dim, params string[] path)
         {
-            if (dim.Equals(m_field) == false)
+            if (dim.Equals(m_field, StringComparison.Ordinal) == false)
             {
                 throw new System.ArgumentException("invalid dim \"" + dim + "\"; should be \"" + m_field + "\"");
             }
diff --git a/src/Lucene.Net.Facet/SortedSet/DefaultSortedSetDocValuesReaderState.cs b/src/Lucene.Net.Facet/SortedSet/DefaultSortedSetDocValuesReaderState.cs
index fcd545b..a183e00 100644
--- a/src/Lucene.Net.Facet/SortedSet/DefaultSortedSetDocValuesReaderState.cs
+++ b/src/Lucene.Net.Facet/SortedSet/DefaultSortedSetDocValuesReaderState.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Index;
 using Lucene.Net.Support;
 using Lucene.Net.Util;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Facet.SortedSet
@@ -79,7 +80,7 @@ namespace Lucene.Net.Facet.SortedSet
                 {
                     throw new System.ArgumentException("this class can only handle 2 level hierarchy (dim/value); got: " + Arrays.ToString(components) + " " + term.Utf8ToString());
                 }
-                if (!components[0].Equals(lastDim))
+                if (!components[0].Equals(lastDim, StringComparison.Ordinal))
                 {
                     if (lastDim != null)
                     {
diff --git a/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs b/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
index 6d811db..549cef6 100644
--- a/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
@@ -223,7 +223,7 @@ namespace Lucene.Net.Facet.Taxonomy
             // from last-first
             for (int i = Length - 1; i >= 0; i--)
             {
-                if (!Components[i].Equals(other.Components[i]))
+                if (!Components[i].Equals(other.Components[i], StringComparison.Ordinal))
                 {
                     return false;
                 }
diff --git a/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs b/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs
index 34dc7d0..9b6bd7e 100644
--- a/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs
@@ -192,7 +192,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
                             recreated = true;
                         }
                     }
-                    else if (!t1.Equals(t2))
+                    else if (!t1.Equals(t2, StringComparison.Ordinal))
                     {
                         // t1 != null and t2 cannot be null b/c DirTaxoWriter always puts the commit data.
                         // it's ok to use String.equals because we require the two epoch values to be the same.
diff --git a/src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs b/src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
index 4904eec..5ee5632 100644
--- a/src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
@@ -152,7 +152,7 @@ namespace Lucene.Net.Facet.Taxonomy
             // from last-first
             for (int i = Length - 1; i >= 0; i--)
             {
-                if (!string.Equals(Components[i], other.Components[i]))
+                if (!Components[i].Equals(other.Components[i], StringComparison.Ordinal))
                 {
                     return false;
                 }
diff --git a/src/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs b/src/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs
index b8ce155..c79776e 100644
--- a/src/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs
@@ -48,7 +48,7 @@ namespace Lucene.Net.Facet.Taxonomy
             string path = null;
             for (int i = 0; i < args.Length; i++)
             {
-                if (args[i].Equals("-printTree"))
+                if (args[i].Equals("-printTree", StringComparison.Ordinal))
                 {
                     printTree = true;
                 }
diff --git a/src/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs b/src/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs
index ec30ce1..ac71f7a 100644
--- a/src/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs
@@ -102,7 +102,7 @@ namespace Lucene.Net.Facet.Taxonomy
         protected virtual DimConfig VerifyDim(string dim)
         {
             DimConfig dimConfig = m_config.GetDimConfig(dim);
-            if (!dimConfig.IndexFieldName.Equals(m_indexFieldName))
+            if (!dimConfig.IndexFieldName.Equals(m_indexFieldName, StringComparison.Ordinal))
             {
                 throw new System.ArgumentException("dimension \"" + dim + "\" was not indexed into field \"" + m_indexFieldName);
             }
@@ -117,7 +117,7 @@ namespace Lucene.Net.Facet.Taxonomy
             {
                 string dim = m_taxoReader.GetPath(ord).Components[0];
                 DimConfig dimConfig = m_config.GetDimConfig(dim);
-                if (dimConfig.IndexFieldName.Equals(m_indexFieldName))
+                if (dimConfig.IndexFieldName.Equals(m_indexFieldName, StringComparison.Ordinal))
                 {
                     FacetResult result = GetTopChildren(topN, dim);
                     if (result != null)
diff --git a/src/Lucene.Net.Highlighter/Highlight/QueryTermExtractor.cs b/src/Lucene.Net.Highlighter/Highlight/QueryTermExtractor.cs
index ec8de66..b19ba22 100644
--- a/src/Lucene.Net.Highlighter/Highlight/QueryTermExtractor.cs
+++ b/src/Lucene.Net.Highlighter/Highlight/QueryTermExtractor.cs
@@ -114,7 +114,7 @@ namespace Lucene.Net.Search.Highlight
                     query.ExtractTerms(nonWeightedTerms);
                     foreach (var term in nonWeightedTerms)
                     {
-                        if ((fieldName == null) || (term.Field.Equals(fieldName)))
+                        if ((fieldName == null) || (term.Field.Equals(fieldName, StringComparison.Ordinal)))
                         {
                             terms.Add(new WeightedTerm(query.Boost, term.Text()));
                         }
diff --git a/src/Lucene.Net.Highlighter/Highlight/WeightedSpanTermExtractor.cs b/src/Lucene.Net.Highlighter/Highlight/WeightedSpanTermExtractor.cs
index 01a21ae..04f2124 100644
--- a/src/Lucene.Net.Highlighter/Highlight/WeightedSpanTermExtractor.cs
+++ b/src/Lucene.Net.Highlighter/Highlight/WeightedSpanTermExtractor.cs
@@ -362,8 +362,8 @@ namespace Lucene.Net.Search.Highlight
         /// </summary>
         protected virtual bool FieldNameComparer(string fieldNameToCheck)
         {
-            bool rv = fieldName == null || fieldName.Equals(fieldNameToCheck)
-                      || fieldNameToCheck.Equals(defaultField);
+            bool rv = fieldName == null || fieldName.Equals(fieldNameToCheck, StringComparison.Ordinal)
+                      || fieldNameToCheck.Equals(defaultField, StringComparison.Ordinal);
             return rv;
         }
 
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
index bd79c80..482716c 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
@@ -88,7 +88,7 @@ namespace Lucene.Net.Search.PostingsHighlight
             else if (query is AutomatonQuery)
             {
                 AutomatonQuery aq = (AutomatonQuery)query;
-                if (aq.Field.Equals(field))
+                if (aq.Field.Equals(field, StringComparison.Ordinal))
                 {
                     list.Add(new CharacterRunAutomatonToStringAnonymousHelper(aq.Automaton, () => aq.ToString()));
                 }
@@ -97,7 +97,7 @@ namespace Lucene.Net.Search.PostingsHighlight
             {
                 PrefixQuery pq = (PrefixQuery)query;
                 Term prefix = pq.Prefix;
-                if (prefix.Field.Equals(field))
+                if (prefix.Field.Equals(field, StringComparison.Ordinal))
                 {
                     list.Add(new CharacterRunAutomatonToStringAnonymousHelper(
                         BasicOperations.Concatenate(BasicAutomata.MakeString(prefix.Text()), BasicAutomata.MakeAnyString()), 
@@ -107,7 +107,7 @@ namespace Lucene.Net.Search.PostingsHighlight
             else if (query is FuzzyQuery)
             {
                 FuzzyQuery fq = (FuzzyQuery)query;
-                if (fq.Field.Equals(field))
+                if (fq.Field.Equals(field, StringComparison.Ordinal))
                 {
                     string utf16 = fq.Term.Text();
                     int[] termText = new int[utf16.CodePointCount(0, utf16.Length)];
@@ -131,7 +131,7 @@ namespace Lucene.Net.Search.PostingsHighlight
             else if (query is TermRangeQuery)
             {
                 TermRangeQuery tq = (TermRangeQuery)query;
-                if (tq.Field.Equals(field))
+                if (tq.Field.Equals(field, StringComparison.Ordinal))
                 {
                     // this is *not* an automaton, but its very simple
                     list.Add(new SimpleCharacterRunAutomatonAnonymousHelper(BasicAutomata.MakeEmpty(), tq));
diff --git a/src/Lucene.Net.Highlighter/VectorHighlight/FieldQuery.cs b/src/Lucene.Net.Highlighter/VectorHighlight/FieldQuery.cs
index 93af641..369c4b7 100644
--- a/src/Lucene.Net.Highlighter/VectorHighlight/FieldQuery.cs
+++ b/src/Lucene.Net.Highlighter/VectorHighlight/FieldQuery.cs
@@ -242,7 +242,7 @@ namespace Lucene.Net.Search.VectorHighlight
             if (a.Slop != b.Slop) return;
             Term[] ats = a.GetTerms();
             Term[] bts = b.GetTerms();
-            if (fieldMatch && !ats[0].Field.Equals(bts[0].Field)) return;
+            if (fieldMatch && !ats[0].Field.Equals(bts[0].Field, StringComparison.Ordinal)) return;
             CheckOverlap(expandQueries, ats, bts, a.Slop, a.Boost);
             CheckOverlap(expandQueries, bts, ats, b.Slop, b.Boost);
         }
@@ -272,7 +272,7 @@ namespace Lucene.Net.Search.VectorHighlight
                 bool overlap = true;
                 for (int j = i; j < src.Length; j++)
                 {
-                    if ((j - i) < dest.Length && !src[j].Text().Equals(dest[j - i].Text()))
+                    if ((j - i) < dest.Length && !src[j].Text().Equals(dest[j - i].Text(), StringComparison.Ordinal))
                     {
                         overlap = false;
                         break;
diff --git a/src/Lucene.Net.Join/TermsIncludingScoreQuery.cs b/src/Lucene.Net.Join/TermsIncludingScoreQuery.cs
index 8991e72..e1876d6 100644
--- a/src/Lucene.Net.Join/TermsIncludingScoreQuery.cs
+++ b/src/Lucene.Net.Join/TermsIncludingScoreQuery.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Join
@@ -89,7 +90,7 @@ namespace Lucene.Net.Join
             if (obj.GetType() != GetType()) return false;
 
             var other = (TermsIncludingScoreQuery)obj;
-            if (!_field.Equals(other._field))
+            if (!_field.Equals(other._field, StringComparison.Ordinal))
             {
                 return false;
             }
diff --git a/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs b/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
index a06fbfc..1728387 100644
--- a/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
+++ b/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
@@ -673,7 +673,7 @@ namespace Lucene.Net.Index.Memory
                 }
                 NumericDocValues norms = cachedNormValues;
                 Similarity sim = Similarity;
-                if (!field.Equals(cachedFieldName) || sim != cachedSimilarity) // not cached?
+                if (!field.Equals(cachedFieldName, StringComparison.Ordinal) || sim != cachedSimilarity) // not cached?
                 {
                     Info info = GetInfo(field);
                     int numTokens = info != null ? info.numTokens : 0;
diff --git a/src/Lucene.Net.Misc/Document/LazyDocument.cs b/src/Lucene.Net.Misc/Document/LazyDocument.cs
index a8b54f0..5b94e37 100644
--- a/src/Lucene.Net.Misc/Document/LazyDocument.cs
+++ b/src/Lucene.Net.Misc/Document/LazyDocument.cs
@@ -166,7 +166,7 @@ namespace Lucene.Net.Documents
                     outerInstance.FetchRealValues(name, fieldNum);
                 }
                 Debug.Assert(HasBeenLoaded, "field value was not lazy loaded");
-                Debug.Assert(realValue.Name.Equals(Name), "realvalue name != name: " + realValue.Name + " != " + Name);
+                Debug.Assert(realValue.Name.Equals(Name, StringComparison.Ordinal), "realvalue name != name: " + realValue.Name + " != " + Name);
 
                 return realValue;
             }
diff --git a/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs b/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs
index a6e4da5..7905791 100644
--- a/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs
+++ b/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs
@@ -44,11 +44,11 @@ namespace Lucene.Net.Index
             while (j < args.Length)
             {
                 string arg = args[j];
-                if ("-extract".Equals(arg))
+                if ("-extract".Equals(arg, StringComparison.Ordinal))
                 {
                     extract = true;
                 }
-                else if ("-dir-impl".Equals(arg))
+                else if ("-dir-impl".Equals(arg, StringComparison.Ordinal))
                 {
                     if (j == args.Length - 1)
                     {
diff --git a/src/Lucene.Net.Misc/Index/IndexSplitter.cs b/src/Lucene.Net.Misc/Index/IndexSplitter.cs
index 62adab3..ecb8842 100644
--- a/src/Lucene.Net.Misc/Index/IndexSplitter.cs
+++ b/src/Lucene.Net.Misc/Index/IndexSplitter.cs
@@ -67,11 +67,11 @@ namespace Lucene.Net.Index
             {
                 throw new Exception("srcdir:" + srcDir.FullName + " doesn't exist");
             }
-            if (args[1].Equals("-l"))
+            if (args[1].Equals("-l", StringComparison.Ordinal))
             {
                 @is.ListSegments();
             }
-            else if (args[1].Equals("-d"))
+            else if (args[1].Equals("-d", StringComparison.Ordinal))
             {
                 IList<string> segs = new List<string>();
                 for (int x = 2; x < args.Length; x++)
@@ -114,7 +114,7 @@ namespace Lucene.Net.Index
         {
             for (int x = 0; x < Infos.Count; x++)
             {
-                if (name.Equals(Infos.Info(x).Info.Name))
+                if (name.Equals(Infos.Info(x).Info.Name, StringComparison.Ordinal))
                 {
                     return x;
                 }
@@ -126,7 +126,7 @@ namespace Lucene.Net.Index
         {
             for (int x = 0; x < Infos.Count; x++)
             {
-                if (name.Equals(Infos.Info(x).Info.Name))
+                if (name.Equals(Infos.Info(x).Info.Name, StringComparison.Ordinal))
                 {
                     return Infos.Info(x);
                 }
diff --git a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
index 79a4bcd..47d61fe 100644
--- a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
+++ b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
@@ -141,15 +141,15 @@ namespace Lucene.Net.Index
                 bool seq = false;
                 for (int i = 0; i < args.Length; i++)
                 {
-                    if (args[i].Equals("-out"))
+                    if (args[i].Equals("-out", StringComparison.Ordinal))
                     {
                         outDir = args[++i];
                     }
-                    else if (args[i].Equals("-num"))
+                    else if (args[i].Equals("-num", StringComparison.Ordinal))
                     {
                         numParts = Convert.ToInt32(args[++i]);
                     }
-                    else if (args[i].Equals("-seq"))
+                    else if (args[i].Equals("-seq", StringComparison.Ordinal))
                     {
                         seq = true;
                     }
diff --git a/src/Lucene.Net.Misc/Index/Sorter/SortingMergePolicy.cs b/src/Lucene.Net.Misc/Index/Sorter/SortingMergePolicy.cs
index 24fa56f..9d77177 100644
--- a/src/Lucene.Net.Misc/Index/Sorter/SortingMergePolicy.cs
+++ b/src/Lucene.Net.Misc/Index/Sorter/SortingMergePolicy.cs
@@ -199,7 +199,7 @@ namespace Lucene.Net.Index.Sorter
                 string diagnosticsSort;
                 if (diagnostics != null 
                     && diagnostics.TryGetValue(SORTER_ID_PROP, out diagnosticsSort)
-                    && sort.ToString().Equals(diagnosticsSort))
+                    && sort.ToString().Equals(diagnosticsSort, StringComparison.Ordinal))
                 {
                     return true;
                 }
diff --git a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs
index 2803be0..fe409f6 100644
--- a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs
+++ b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Misc
 
             for (int i = 1; i < args.Length; i++)
             {
-                if (args[i].Equals("-t"))
+                if (args[i].Equals("-t", StringComparison.Ordinal))
                 {
                     comparer = new TotalTermFreqComparer();
                 }
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs
index 9bab31f..be51be6 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs
@@ -195,7 +195,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
                 return false;
             }
             var other = (DocFreqValueSource)o;
-            return this.m_indexedField.Equals(other.m_indexedField) && this.m_indexedBytes.Equals(other.m_indexedBytes);
+            return this.m_indexedField.Equals(other.m_indexedField, StringComparison.Ordinal) && this.m_indexedBytes.Equals(other.m_indexedBytes);
         }
     }
 }
\ No newline at end of file
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/FieldCacheSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/FieldCacheSource.cs
index cc05c64..28c5944 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/FieldCacheSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/FieldCacheSource.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Search;
+using System;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
@@ -61,7 +62,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
             {
                 return false;
             }
-            return m_field.Equals(other.m_field) && m_cache == other.m_cache;
+            return m_field.Equals(other.m_field, StringComparison.Ordinal) && m_cache == other.m_cache;
         }
 
         public override int GetHashCode()
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs
index bca06eb..4363675 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs
@@ -106,7 +106,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
                 return false;
             }
             var other = (JoinDocFreqValueSource)o;
-            if (!m_qfield.Equals(other.m_qfield))
+            if (!m_qfield.Equals(other.m_qfield, StringComparison.Ordinal))
             {
                 return false;
             }
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/LiteralValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/LiteralValueSource.cs
index f6ca6ff..a3b0e17 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/LiteralValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/LiteralValueSource.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Util;
+using System;
 using System.Collections;
 
 namespace Lucene.Net.Queries.Function.ValueSources
@@ -93,7 +94,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
             var that = o as LiteralValueSource;
             if (that == null)
                 return false;
-            return m_str.Equals(that.m_str);
+            return m_str.Equals(that.m_str, StringComparison.Ordinal);
 
         }
 
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs
index 3815796..da7b356 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs
@@ -2,6 +2,7 @@
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Support;
+using System;
 using System.Collections;
 using System.Text;
 
@@ -139,7 +140,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
             var other = o as MultiSingleFunction;
             if (other == null)
                 return false;
-            return Name.Equals(other.Name) && Arrays.Equals(this.m_sources, other.m_sources);
+            return Name.Equals(other.Name, StringComparison.Ordinal) && Arrays.Equals(this.m_sources, other.m_sources);
         }
     }
 }
\ No newline at end of file
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs
index 7d06ab8..19ffc4c 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs
@@ -2,6 +2,7 @@
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Search.Similarities;
+using System;
 using System.Collections;
 
 namespace Lucene.Net.Queries.Function.ValueSources
@@ -103,7 +104,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
             {
                 return false;
             }
-            return this.m_field.Equals(((NormValueSource)o).m_field);
+            return this.m_field.Equals(((NormValueSource)o).m_field, StringComparison.Ordinal);
         }
 
         public override int GetHashCode()
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
index 9bb3ab8..c8a0c09 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
@@ -2,6 +2,7 @@
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util.Mutable;
+using System;
 using System.Collections;
 
 namespace Lucene.Net.Queries.Function.ValueSources
@@ -144,7 +145,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
 
         public override bool Equals(object o)
         {
-            return o != null && o.GetType() == typeof(OrdFieldSource) && this.m_field.Equals(((OrdFieldSource)o).m_field);
+            return o != null && o.GetType() == typeof(OrdFieldSource) && this.m_field.Equals(((OrdFieldSource)o).m_field, StringComparison.Ordinal);
         }
 
         private static readonly int hcode = typeof(OrdFieldSource).GetHashCode();
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
index e212dec..ff315bc 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
+using System;
 using System.Collections;
 
 namespace Lucene.Net.Queries.Function.ValueSources
@@ -109,7 +110,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
             var other = o as ReverseOrdFieldSource;
             if (other == null)
                 return false;
-            return this.field.Equals(other.field);
+            return this.field.Equals(other.field, StringComparison.Ordinal);
         }
 
         private static readonly int hcode = typeof(ReverseOrdFieldSource).GetHashCode();
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
index 89c225f..a241af3 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Search;
+using System;
 using System.Collections;
 
 namespace Lucene.Net.Queries.Function.ValueSources
@@ -51,7 +52,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
             var other = o as SingularFunction;
             if (other == null)
                 return false;
-            return Name.Equals(other.Name) 
+            return Name.Equals(other.Name, StringComparison.Ordinal) 
                 && m_source.Equals(other.m_source);
         }
 
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
index 9b9e183..ec03a69 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
+using System;
 using System.Collections;
 
 namespace Lucene.Net.Queries.Function.ValueSources
@@ -115,7 +116,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
             var other = o as SumTotalTermFreqValueSource;
             if (other == null)
                 return false;
-            return this.m_indexedField.Equals(other.m_indexedField);
+            return this.m_indexedField.Equals(other.m_indexedField, StringComparison.Ordinal);
         }
     }
 }
\ No newline at end of file
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
index e008090..69eb234 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
@@ -2,6 +2,7 @@
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
+using System;
 using System.Collections;
 
 namespace Lucene.Net.Queries.Function.ValueSources
@@ -114,7 +115,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
                 return false;
             }
             var other = (TotalTermFreqValueSource)o;
-            return this.m_indexedField.Equals(other.m_indexedField) && this.m_indexedBytes.Equals(other.m_indexedBytes);
+            return this.m_indexedField.Equals(other.m_indexedField, StringComparison.Ordinal) && this.m_indexedBytes.Equals(other.m_indexedBytes);
         }
     }
 }
\ No newline at end of file
diff --git a/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs b/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
index 999cc7a..4920e63 100644
--- a/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
+++ b/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
@@ -5,6 +5,7 @@ using Lucene.Net.Analysis;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Support;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics.CodeAnalysis;
 using System.IO;
@@ -184,7 +185,7 @@ namespace Lucene.Net.Queries.Mlt
                     return false;
                 }
             }
-            else if (!fieldName.Equals(other.fieldName))
+            else if (!fieldName.Equals(other.fieldName, StringComparison.Ordinal))
             {
                 return false;
             }
@@ -195,7 +196,7 @@ namespace Lucene.Net.Queries.Mlt
                     return false;
                 }
             }
-            else if (!likeText.Equals(other.likeText))
+            else if (!likeText.Equals(other.likeText, StringComparison.Ordinal))
             {
                 return false;
             }
diff --git a/src/Lucene.Net.Queries/TermsFilter.cs b/src/Lucene.Net.Queries/TermsFilter.cs
index 705e441..6d728ba 100644
--- a/src/Lucene.Net.Queries/TermsFilter.cs
+++ b/src/Lucene.Net.Queries/TermsFilter.cs
@@ -181,7 +181,7 @@ namespace Lucene.Net.Queries
                 if (previousField != null)
                 {
                     // deduplicate
-                    if (previousField.Equals(currentField))
+                    if (previousField.Equals(currentField, StringComparison.Ordinal))
                     {
                         if (previousTerm.BytesEquals(currentTerm))
                         {
@@ -365,7 +365,7 @@ namespace Lucene.Net.Queries
                         return false;
                     }
                 }
-                else if (!field.Equals(other.field))
+                else if (!field.Equals(other.field, StringComparison.Ordinal))
                 {
                     return false;
                 }
diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParser.cs b/src/Lucene.Net.QueryParser/Classic/QueryParser.cs
index a525a98..4eee7fd 100644
--- a/src/Lucene.Net.QueryParser/Classic/QueryParser.cs
+++ b/src/Lucene.Net.QueryParser/Classic/QueryParser.cs
@@ -494,7 +494,7 @@ namespace Lucene.Net.QueryParsers.Classic
                     {
                         goop1.Image = goop1.Image.Substring(1, goop1.Image.Length - 2);
                     }
-                    else if ("*".Equals(goop1.Image))
+                    else if ("*".Equals(goop1.Image, StringComparison.Ordinal))
                     {
                         startOpen = true;
                     }
@@ -502,7 +502,7 @@ namespace Lucene.Net.QueryParsers.Classic
                     {
                         goop2.Image = goop2.Image.Substring(1, goop2.Image.Length - 2);
                     }
-                    else if ("*".Equals(goop2.Image))
+                    else if ("*".Equals(goop2.Image, StringComparison.Ordinal))
                     {
                         endOpen = true;
                     }
diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
index 65634bc..67e56b8 100644
--- a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
+++ b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
@@ -751,9 +751,9 @@ namespace Lucene.Net.QueryParsers.Classic
         /// <returns>Resulting <see cref="Query"/> built for the term</returns>
         protected internal virtual Query GetWildcardQuery(string field, string termStr)
         {
-            if ("*".Equals(field))
+            if ("*".Equals(field, StringComparison.Ordinal))
             {
-                if ("*".Equals(termStr)) return NewMatchAllDocsQuery();
+                if ("*".Equals(termStr, StringComparison.Ordinal)) return NewMatchAllDocsQuery();
             }
             if (!AllowLeadingWildcard && (termStr.StartsWith("*", StringComparison.Ordinal) || termStr.StartsWith("?", StringComparison.Ordinal)))
                 throw new ParseException("'*' or '?' not allowed as first character in WildcardQuery");
diff --git a/src/Lucene.Net.QueryParser/ComplexPhrase/ComplexPhraseQueryParser.cs b/src/Lucene.Net.QueryParser/ComplexPhrase/ComplexPhraseQueryParser.cs
index 02c6d2b..af198b6 100644
--- a/src/Lucene.Net.QueryParser/ComplexPhrase/ComplexPhraseQueryParser.cs
+++ b/src/Lucene.Net.QueryParser/ComplexPhrase/ComplexPhraseQueryParser.cs
@@ -152,7 +152,7 @@ namespace Lucene.Net.QueryParsers.ComplexPhrase
         // Helper method used to report on any clauses that appear in query syntax
         private void CheckPhraseClauseIsForSameField(string field)
         {
-            if (!field.Equals(currentPhraseQuery.Field))
+            if (!field.Equals(currentPhraseQuery.Field, StringComparison.Ordinal))
             {
                 throw new ParseException("Cannot have clause for field \"" + field
                     + "\" nested in phrase " + " for field \"" + currentPhraseQuery.Field
@@ -449,7 +449,7 @@ namespace Lucene.Net.QueryParsers.ComplexPhrase
                     if (other.field != null)
                         return false;
                 }
-                else if (!field.Equals(other.field))
+                else if (!field.Equals(other.field, StringComparison.Ordinal))
                     return false;
                 if (phrasedQueryStringContents == null)
                 {
@@ -457,7 +457,7 @@ namespace Lucene.Net.QueryParsers.ComplexPhrase
                         return false;
                 }
                 else if (!phrasedQueryStringContents
-                  .Equals(other.phrasedQueryStringContents))
+                  .Equals(other.phrasedQueryStringContents, StringComparison.Ordinal))
                     return false;
                 if (slopFactor != other.slopFactor)
                     return false;
diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/QueryNodeImpl.cs b/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/QueryNodeImpl.cs
index a1d56c0..b779f9a 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/QueryNodeImpl.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/QueryNodeImpl.cs
@@ -236,7 +236,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Nodes
                 return true;
             if (fld == null)
                 return true;
-            if (QueryNode.PLAINTEXT_FIELD_NAME.Equals(StringUtils.ToString(fld)))
+            if (QueryNode.PLAINTEXT_FIELD_NAME.Equals(StringUtils.ToString(fld), StringComparison.Ordinal))
                 return true;
             return false;
         }
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/AbstractRangeQueryNode.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/AbstractRangeQueryNode.cs
index 5c44a1c..f7e9eb2 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/AbstractRangeQueryNode.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/AbstractRangeQueryNode.cs
@@ -142,8 +142,8 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Nodes
                 string upperField = StringUtils.ToString(upper.Field);
 
                 if ((upperField != null || lowerField != null)
-                    && ((upperField != null && !upperField.Equals(lowerField)) || !lowerField
-                        .Equals(upperField)))
+                    && ((upperField != null && !upperField.Equals(lowerField, StringComparison.Ordinal)) || !lowerField
+                        .Equals(upperField, StringComparison.Ordinal)))
                 {
                     throw new ArgumentException(
                         "lower and upper bounds should have the same field name!");
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/MatchAllDocsQueryNodeProcessor.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/MatchAllDocsQueryNodeProcessor.cs
index 16dad85..d7a1298 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/MatchAllDocsQueryNodeProcessor.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/MatchAllDocsQueryNodeProcessor.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.QueryParsers.Flexible.Core.Nodes;
 using Lucene.Net.QueryParsers.Flexible.Core.Processors;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
@@ -40,8 +41,8 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
             {
                 FieldQueryNode fqn = (FieldQueryNode)node;
 
-                if (fqn.Field.ToString().Equals("*")
-                    && fqn.Text.ToString().Equals("*"))
+                if (fqn.Field.ToString().Equals("*", StringComparison.Ordinal)
+                    && fqn.Text.ToString().Equals("*", StringComparison.Ordinal))
                 {
                     return new MatchAllDocsQueryNode();
                 }
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/OpenRangeQueryNodeProcessor.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/OpenRangeQueryNodeProcessor.cs
index 3f4932d..9eded07 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/OpenRangeQueryNodeProcessor.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/OpenRangeQueryNodeProcessor.cs
@@ -3,6 +3,7 @@ using Lucene.Net.QueryParsers.Flexible.Core.Processors;
 using Lucene.Net.QueryParsers.Flexible.Core.Util;
 using Lucene.Net.QueryParsers.Flexible.Standard.Nodes;
 using Lucene.Net.Support;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
@@ -43,14 +44,14 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Processors
                 ICharSequence lowerText = lowerNode.Text;
                 ICharSequence upperText = upperNode.Text;
 
-                if (OPEN_RANGE_TOKEN.Equals(upperNode.GetTextAsString())
+                if (OPEN_RANGE_TOKEN.Equals(upperNode.GetTextAsString(), StringComparison.Ordinal)
                     && (!(upperText is UnescapedCharSequence) || !((UnescapedCharSequence)upperText)
                         .WasEscaped(0)))
                 {
                     upperText = "".ToCharSequence();
                 }
 
-                if (OPEN_RANGE_TOKEN.Equals(lowerNode.GetTextAsString())
+                if (OPEN_RANGE_TOKEN.Equals(lowerNode.GetTextAsString(), StringComparison.Ordinal)
                     && (!(lowerText is UnescapedCharSequence) || !((UnescapedCharSequence)lowerText)
                         .WasEscaped(0)))
                 {
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
index b2d3c5b..c9857f5 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
@@ -68,7 +68,7 @@ namespace Lucene.Net.QueryParsers.Surround.Query
             if (!GetType().Equals(obj.GetType()))
                 return false;
             RewriteQuery<SQ> other = (RewriteQuery<SQ>)obj;
-            return m_fieldName.Equals(other.m_fieldName)
+            return m_fieldName.Equals(other.m_fieldName, StringComparison.Ordinal)
                 && m_qf.Equals(other.m_qf)
                 && m_srndQuery.Equals(other.m_srndQuery);
         }
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
index 93272e1..2b8a486 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
@@ -119,7 +119,7 @@ namespace Lucene.Net.QueryParsers.Surround.Query
                 return false;
             if (!GetType().Equals(obj.GetType()))
                 return false;
-            return ToString().Equals(obj.ToString());
+            return ToString().Equals(obj.ToString(), StringComparison.Ordinal);
         }
 
         /// <summary> An empty Lucene query  </summary>
diff --git a/src/Lucene.Net.QueryParser/Xml/Builders/BooleanQueryBuilder.cs b/src/Lucene.Net.QueryParser/Xml/Builders/BooleanQueryBuilder.cs
index c2d7600..c7a2eb1 100644
--- a/src/Lucene.Net.QueryParser/Xml/Builders/BooleanQueryBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Xml/Builders/BooleanQueryBuilder.cs
@@ -79,7 +79,7 @@ namespace Lucene.Net.QueryParsers.Xml.Builders
                 }
                 else
                 {
-                    if (("should".Equals(occs, StringComparison.OrdinalIgnoreCase)) || ("".Equals(occs)))
+                    if (("should".Equals(occs, StringComparison.OrdinalIgnoreCase)) || ("".Equals(occs, StringComparison.Ordinal)))
                     {
                         occurs = Occur.SHOULD;
                     }
diff --git a/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs b/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs
index 72f99d8..364f61d 100644
--- a/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs
+++ b/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs
@@ -89,7 +89,7 @@ namespace Lucene.Net.QueryParsers.Xml
         {
             for (XmlNode kid = e.FirstChild; kid != null; kid = kid.NextSibling)
             {
-                if ((kid.NodeType == XmlNodeType.Element) && (name.Equals(kid.Name)))
+                if ((kid.NodeType == XmlNodeType.Element) && (name.Equals(kid.Name, StringComparison.Ordinal)))
                 {
                     return (XmlElement)kid;
                 }
@@ -106,7 +106,7 @@ namespace Lucene.Net.QueryParsers.Xml
         public static string GetAttributeWithInheritance(XmlElement element, string attributeName)
         {
             string result = element.GetAttribute(attributeName);
-            if ((result == null) || ("".Equals(result)))
+            if ((result == null) || ("".Equals(result, StringComparison.Ordinal)))
             {
                 XmlNode n = element.ParentNode;
                 if ((n == element) || (n == null))
@@ -146,26 +146,26 @@ namespace Lucene.Net.QueryParsers.Xml
         public static string GetAttribute(XmlElement element, string attributeName, string deflt)
         {
             string result = element.GetAttribute(attributeName);
-            return (result == null) || ("".Equals(result)) ? deflt : result;
+            return (result == null) || ("".Equals(result, StringComparison.Ordinal)) ? deflt : result;
         }
 
         public static float GetAttribute(XmlElement element, string attributeName, float deflt)
         {
             string result = element.GetAttribute(attributeName);
-            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToSingle(result, CultureInfo.InvariantCulture);
+            return (result == null) || ("".Equals(result, StringComparison.Ordinal)) ? deflt : Convert.ToSingle(result, CultureInfo.InvariantCulture);
         }
 
         public static int GetAttribute(XmlElement element, string attributeName, int deflt)
         {
             string result = element.GetAttribute(attributeName);
-            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToInt32(result, CultureInfo.InvariantCulture);
+            return (result == null) || ("".Equals(result, StringComparison.Ordinal)) ? deflt : Convert.ToInt32(result, CultureInfo.InvariantCulture);
         }
 
         public static bool GetAttribute(XmlElement element, string attributeName,
                                            bool deflt)
         {
             string result = element.GetAttribute(attributeName);
-            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToBoolean(result, CultureInfo.InvariantCulture);
+            return (result == null) || ("".Equals(result, StringComparison.Ordinal)) ? deflt : Convert.ToBoolean(result, CultureInfo.InvariantCulture);
         }
 
         /* Returns text of node and all child nodes - without markup */
diff --git a/src/Lucene.Net.Replicator/IndexAndTaxonomyRevision.cs b/src/Lucene.Net.Replicator/IndexAndTaxonomyRevision.cs
index de1ed16..ba6e90e 100644
--- a/src/Lucene.Net.Replicator/IndexAndTaxonomyRevision.cs
+++ b/src/Lucene.Net.Replicator/IndexAndTaxonomyRevision.cs
@@ -186,8 +186,8 @@ namespace Lucene.Net.Replicator
         /// <exception cref="IOException"></exception>
         public virtual Stream Open(string source, string fileName)
         {
-            Debug.Assert(source.Equals(INDEX_SOURCE) || source.Equals(TAXONOMY_SOURCE), string.Format("invalid source; expected=({0} or {1}) got={2}", INDEX_SOURCE, TAXONOMY_SOURCE, source));
-            IndexCommit commit = source.Equals(INDEX_SOURCE) ? indexCommit : taxonomyCommit;
+            Debug.Assert(source.Equals(INDEX_SOURCE, StringComparison.Ordinal) || source.Equals(TAXONOMY_SOURCE, StringComparison.Ordinal), string.Format("invalid source; expected=({0} or {1}) got={2}", INDEX_SOURCE, TAXONOMY_SOURCE, source));
+            IndexCommit commit = source.Equals(INDEX_SOURCE, StringComparison.Ordinal) ? indexCommit : taxonomyCommit;
             return new IndexInputStream(commit.Directory.OpenInput(fileName, IOContext.READ_ONCE));
         }
 
diff --git a/src/Lucene.Net.Replicator/IndexReplicationHandler.cs b/src/Lucene.Net.Replicator/IndexReplicationHandler.cs
index 99d3445..93274a1 100644
--- a/src/Lucene.Net.Replicator/IndexReplicationHandler.cs
+++ b/src/Lucene.Net.Replicator/IndexReplicationHandler.cs
@@ -115,7 +115,7 @@ namespace Lucene.Net.Replicator
             string segmentsFile = files.Last();
             //NOTE: Relying on side-effects outside?
             files.RemoveAt(files.Count - 1);
-            if (!segmentsFile.StartsWith(IndexFileNames.SEGMENTS) || segmentsFile.Equals(IndexFileNames.SEGMENTS_GEN))
+            if (!segmentsFile.StartsWith(IndexFileNames.SEGMENTS) || segmentsFile.Equals(IndexFileNames.SEGMENTS_GEN, StringComparison.Ordinal))
             {
                 throw new InvalidOperationException(
                     string.Format("last file to copy+sync must be segments_N but got {0}; check your Revision implementation!", segmentsFile));
@@ -163,7 +163,7 @@ namespace Lucene.Net.Replicator
                 // if there were any IO errors reading the expected commit point (i.e.
                 // segments files mismatch), then ignore that commit either.
 
-                if (commit != null && commit.SegmentsFileName.Equals(segmentsFile))
+                if (commit != null && commit.SegmentsFileName.Equals(segmentsFile, StringComparison.Ordinal))
                 {
                     HashSet<string> commitFiles = new HashSet<string>( commit.FileNames
                         .Union(new[] {IndexFileNames.SEGMENTS_GEN}));
diff --git a/src/Lucene.Net.Replicator/IndexRevision.cs b/src/Lucene.Net.Replicator/IndexRevision.cs
index 092fc3e..e35939c 100644
--- a/src/Lucene.Net.Replicator/IndexRevision.cs
+++ b/src/Lucene.Net.Replicator/IndexRevision.cs
@@ -65,7 +65,7 @@ namespace Lucene.Net.Replicator
         public static IDictionary<string, IList<RevisionFile>> RevisionFiles(IndexCommit commit)
         {
             List<RevisionFile> revisionFiles = commit.FileNames
-                .Where(file => !string.Equals(file, commit.SegmentsFileName))
+                .Where(file => !string.Equals(file, commit.SegmentsFileName, StringComparison.Ordinal))
                 .Select(file => CreateRevisionFile(file, commit.Directory))
                 //Note: segments_N must be last
                 .Union(new[] {CreateRevisionFile(commit.SegmentsFileName, commit.Directory)})
@@ -125,7 +125,7 @@ namespace Lucene.Net.Replicator
 
         public virtual Stream Open(string source, string fileName)
         {
-            Debug.Assert(source.Equals(SOURCE), string.Format("invalid source; expected={0} got={1}", SOURCE, source));
+            Debug.Assert(source.Equals(SOURCE, StringComparison.Ordinal), string.Format("invalid source; expected={0} got={1}", SOURCE, source));
             return new IndexInputStream(commit.Directory.OpenInput(fileName, IOContext.READ_ONCE));
         }
 
diff --git a/src/Lucene.Net.Replicator/RevisionFile.cs b/src/Lucene.Net.Replicator/RevisionFile.cs
index 139ac23..3273a14 100644
--- a/src/Lucene.Net.Replicator/RevisionFile.cs
+++ b/src/Lucene.Net.Replicator/RevisionFile.cs
@@ -64,7 +64,7 @@ namespace Lucene.Net.Replicator
         {
             if (ReferenceEquals(null, other)) return false;
             if (ReferenceEquals(this, other)) return true;
-            return string.Equals(FileName, other.FileName) && Length == other.Length;
+            return string.Equals(FileName, other.FileName, StringComparison.Ordinal) && Length == other.Length;
         }
 
         public override int GetHashCode()
diff --git a/src/Lucene.Net.Sandbox/Queries/DuplicateFilter.cs b/src/Lucene.Net.Sandbox/Queries/DuplicateFilter.cs
index 9d716f9..769822a 100644
--- a/src/Lucene.Net.Sandbox/Queries/DuplicateFilter.cs
+++ b/src/Lucene.Net.Sandbox/Queries/DuplicateFilter.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
+using System;
 
 namespace Lucene.Net.Sandbox.Queries
 {
@@ -204,7 +205,7 @@ namespace Lucene.Net.Sandbox.Queries
             DuplicateFilter other = (DuplicateFilter)obj;
             return keepMode == other.keepMode &&
                 processingMode == other.processingMode &&
-                fieldName != null && fieldName.Equals(other.fieldName);
+                fieldName != null && fieldName.Equals(other.fieldName, StringComparison.Ordinal);
         }
 
 
diff --git a/src/Lucene.Net.Sandbox/Queries/SlowFuzzyQuery.cs b/src/Lucene.Net.Sandbox/Queries/SlowFuzzyQuery.cs
index 9a068f1..2701b2c 100644
--- a/src/Lucene.Net.Sandbox/Queries/SlowFuzzyQuery.cs
+++ b/src/Lucene.Net.Sandbox/Queries/SlowFuzzyQuery.cs
@@ -166,7 +166,7 @@ namespace Lucene.Net.Sandbox.Queries
         public override string ToString(string field)
         {
             StringBuilder buffer = new StringBuilder();
-            if (!m_term.Field.Equals(field))
+            if (!m_term.Field.Equals(field, StringComparison.Ordinal))
             {
                 buffer.Append(m_term.Field);
                 buffer.Append(":");
diff --git a/src/Lucene.Net.Spatial/DisjointSpatialFilter.cs b/src/Lucene.Net.Spatial/DisjointSpatialFilter.cs
index 13512c8..d9c5a72 100644
--- a/src/Lucene.Net.Spatial/DisjointSpatialFilter.cs
+++ b/src/Lucene.Net.Spatial/DisjointSpatialFilter.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Spatial
                 return false;
             }
             var that = (DisjointSpatialFilter)o;
-            if (field != null ? !field.Equals(that.field) : that.field != null)
+            if (field != null ? !field.Equals(that.field, StringComparison.Ordinal) : that.field != null)
             {
                 return false;
             }
diff --git a/src/Lucene.Net.Spatial/Prefix/AbstractPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/AbstractPrefixTreeFilter.cs
index 5491a54..a9230cf 100644
--- a/src/Lucene.Net.Spatial/Prefix/AbstractPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/AbstractPrefixTreeFilter.cs
@@ -3,6 +3,7 @@ using Lucene.Net.Search;
 using Lucene.Net.Spatial.Prefix.Tree;
 using Lucene.Net.Util;
 using Spatial4n.Core.Shapes;
+using System;
 using System.Diagnostics;
 
 namespace Lucene.Net.Spatial.Prefix
@@ -58,7 +59,7 @@ namespace Lucene.Net.Spatial.Prefix
             {
                 return false;
             }
-            if (!m_fieldName.Equals(that.m_fieldName))
+            if (!m_fieldName.Equals(that.m_fieldName, StringComparison.Ordinal))
             {
                 return false;
             }
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs b/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
index 3182a93..86fb3ab 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
@@ -288,7 +288,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
         public override bool Equals(object obj)
         {
             return !(obj == null || !(obj is Cell)) &&
-                   TokenString.Equals(((Cell)obj).TokenString);
+                   TokenString.Equals(((Cell)obj).TokenString, StringComparison.Ordinal);
         }
 
         public override int GetHashCode()
diff --git a/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs b/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs
index 247cc8f..e18669b 100644
--- a/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs
+++ b/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs
@@ -330,7 +330,7 @@ namespace Lucene.Net.Spatial.Serialized
 
                 ShapeDocValueSource that = (ShapeDocValueSource)o;
 
-                if (!fieldName.Equals(that.fieldName)) return false;
+                if (!fieldName.Equals(that.fieldName, StringComparison.Ordinal)) return false;
 
                 return true;
             }
diff --git a/src/Lucene.Net.Suggest/Spell/SpellChecker.cs b/src/Lucene.Net.Suggest/Spell/SpellChecker.cs
index 10aee12..5cebc1a 100644
--- a/src/Lucene.Net.Suggest/Spell/SpellChecker.cs
+++ b/src/Lucene.Net.Suggest/Spell/SpellChecker.cs
@@ -375,7 +375,7 @@ namespace Lucene.Net.Search.Spell
                     sugWord.String = indexSearcher.Doc(hits[i].Doc).Get(F_WORD); // get orig word
 
                     // don't suggest a word for itself, that would be silly
-                    if (sugWord.String.Equals(word))
+                    if (sugWord.String.Equals(word, StringComparison.Ordinal))
                     {
                         continue;
                     }
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
index bbe19fb..22f2dd6 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
@@ -271,7 +271,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
 
             protected override TokenStreamComponents WrapComponents(string fieldName, TokenStreamComponents components)
             {
-                if (fieldName.Equals("textgrams") && outerInstance.minPrefixChars > 0)
+                if (fieldName.Equals("textgrams", StringComparison.Ordinal) && outerInstance.minPrefixChars > 0)
                 {
                     return new TokenStreamComponents(components.Tokenizer, 
                         new EdgeNGramTokenFilter(
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/CharFilters/HTMLStripCharFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/CharFilters/HTMLStripCharFilterTest.cs
index e81038c..ea10176 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/CharFilters/HTMLStripCharFilterTest.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/CharFilters/HTMLStripCharFilterTest.cs
@@ -721,7 +721,7 @@ namespace Lucene.Net.Analysis.CharFilters
             }
             catch (Exception e)
             {
-                if (gold.Equals(builder.ToString()))
+                if (gold.Equals(builder.ToString(), StringComparison.Ordinal))
                 {
                     throw e;
                 }
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilter.cs
index 95c7247..a516a8b 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilter.cs
@@ -190,7 +190,7 @@ namespace Lucene.Net.Analysis.Core
                 }
                 else if (m_input.IncrementToken())
                 {
-                    if (termAtt.ToString().Equals("the"))
+                    if (termAtt.ToString().Equals("the", StringComparison.Ordinal))
                     {
                         bufferedState = CaptureState();
                     }
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
index c7b45ea..c1a1b97 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
@@ -206,7 +206,7 @@ namespace Lucene.Net.Analysis.Hunspell
             string toTest = "hu_HU.zip";
             for (int i = 0; i < tests.Length; i++)
             {
-                if (tests[i].Equals(toTest))
+                if (tests[i].Equals(toTest, StringComparison.Ordinal))
                 {
                     FileInfo f = new FileInfo(System.IO.Path.Combine(DICTIONARY_HOME.FullName, tests[i]));
                     Debug.Assert(f.Exists);
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
index 58938e3..018dc7a 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
@@ -224,7 +224,7 @@ namespace Lucene.Net.Analysis.Hunspell
             string toTest = "lithuanian_spelling_check_dictionary-1.3-fx+tb+sm+fn.xpi";
             for (int i = 0; i < tests.Length; i++)
             {
-                if (tests[i].Equals(toTest))
+                if (tests[i].Equals(toTest, StringComparison.Ordinal))
                 {
                     FileInfo f = new FileInfo(System.IO.Path.Combine(DICTIONARY_HOME.FullName, tests[i]));
                     Debug.Assert(f.Exists);
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestASCIIFoldingFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestASCIIFoldingFilter.cs
index d4d246f..450fcd6 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestASCIIFoldingFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestASCIIFoldingFilter.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Analysis.Core;
 using Lucene.Net.Analysis.TokenAttributes;
 using NUnit.Framework;
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Text;
@@ -33,7 +34,7 @@ namespace Lucene.Net.Analysis.Miscellaneous
         {
             assertTrue(filter.IncrementToken());
             assertEquals(expectedFolded, termAtt.ToString());
-            if (filter.PreserveOriginal && !expectedUnfolded.Equals(expectedFolded))
+            if (filter.PreserveOriginal && !expectedUnfolded.Equals(expectedFolded, StringComparison.Ordinal))
             {
                 assertTrue(filter.IncrementToken());
                 assertEquals(expectedUnfolded, termAtt.ToString());
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLucene47WordDelimiterFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLucene47WordDelimiterFilter.cs
index 48d76d7..218a0a5 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLucene47WordDelimiterFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLucene47WordDelimiterFilter.cs
@@ -222,7 +222,7 @@ namespace Lucene.Net.Analysis.Miscellaneous
             {
                 if (m_input.IncrementToken())
                 {
-                    if (termAtt.ToString().Equals("largegap") || termAtt.ToString().Equals("/"))
+                    if (termAtt.ToString().Equals("largegap", StringComparison.Ordinal) || termAtt.ToString().Equals("/", StringComparison.Ordinal))
                     {
                         posIncAtt.PositionIncrement = 10;
                     }
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestWordDelimiterFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestWordDelimiterFilter.cs
index 0e9bf46..d1c14b6 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestWordDelimiterFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestWordDelimiterFilter.cs
@@ -216,7 +216,7 @@ namespace Lucene.Net.Analysis.Miscellaneous
             {
                 if (m_input.IncrementToken())
                 {
-                    if (termAtt.ToString().Equals("largegap") || termAtt.ToString().Equals("/"))
+                    if (termAtt.ToString().Equals("largegap", StringComparison.Ordinal) || termAtt.ToString().Equals("/", StringComparison.Ordinal))
                     {
                         posIncAtt.PositionIncrement = 10;
                     }
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilter.cs
index 2fdec2b..5f07f96 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilter.cs
@@ -79,8 +79,8 @@ namespace Lucene.Net.Analysis.Pattern
                 }
             }
 
-            bool outputGood = expectedOutput.Equals(output.ToString());
-            bool indexMatchedGood = expectedIndexMatchedOutput.Equals(indexMatched.ToString());
+            bool outputGood = expectedOutput.Equals(output.ToString(), StringComparison.Ordinal);
+            bool indexMatchedGood = expectedIndexMatchedOutput.Equals(indexMatched.ToString(), StringComparison.Ordinal);
 
             if (!outputGood || !indexMatchedGood || false)
             {
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterTest.cs
index bbb5acb..f261749 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterTest.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterTest.cs
@@ -38,10 +38,10 @@ namespace Lucene.Net.Analysis.Payloads
             nptf.Reset();
             while (nptf.IncrementToken())
             {
-                if (termAtt.ToString().Equals("dogs"))
+                if (termAtt.ToString().Equals("dogs", StringComparison.Ordinal))
                 {
                     seenDogs = true;
-                    assertTrue(typeAtt.Type + " is not equal to " + "D", typeAtt.Type.Equals("D") == true);
+                    assertTrue(typeAtt.Type + " is not equal to " + "D", typeAtt.Type.Equals("D", StringComparison.Ordinal) == true);
                     assertTrue("payloadAtt.getPayload() is null and it shouldn't be", payloadAtt.Payload != null);
                     byte[] bytes = payloadAtt.Payload.Bytes; //safe here to just use the bytes, otherwise we should use offset, length
                     assertTrue(bytes.Length + " does not equal: " + payloadAtt.Payload.Length, bytes.Length == payloadAtt.Payload.Length);
@@ -51,7 +51,7 @@ namespace Lucene.Net.Analysis.Payloads
                 }
                 else
                 {
-                    assertTrue(typeAtt.Type + " is not null and it should be", typeAtt.Type.Equals("word"));
+                    assertTrue(typeAtt.Type + " is not null and it should be", typeAtt.Type.Equals("word", StringComparison.Ordinal));
                 }
             }
             assertTrue(seenDogs + " does not equal: " + true, seenDogs == true);
@@ -75,7 +75,7 @@ namespace Lucene.Net.Analysis.Payloads
             {
                 if (m_input.IncrementToken())
                 {
-                    if (termAtt.ToString().Equals("dogs"))
+                    if (termAtt.ToString().Equals("dogs", StringComparison.Ordinal))
                     {
                         typeAtt.Type = "D";
                     }
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterTest.cs
index 5a3a62f..68161e6 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterTest.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterTest.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Analysis.TokenAttributes;
 using NUnit.Framework;
+using System;
 using System.IO;
 
 namespace Lucene.Net.Analysis.Payloads
@@ -38,10 +39,10 @@ namespace Lucene.Net.Analysis.Payloads
             nptf.Reset();
             while (nptf.IncrementToken())
             {
-                assertTrue(typeAtt.Type + " is not null and it should be", typeAtt.Type.Equals(char.ToUpper(termAtt.Buffer[0]).ToString()));
+                assertTrue(typeAtt.Type + " is not null and it should be", typeAtt.Type.Equals(char.ToUpper(termAtt.Buffer[0]).ToString(), StringComparison.Ordinal));
                 assertTrue("nextToken.getPayload() is null and it shouldn't be", payloadAtt.Payload != null);
                 string type = payloadAtt.Payload.Utf8ToString();
-                assertTrue(type + " is not equal to " + typeAtt.Type, type.Equals(typeAtt.Type));
+                assertTrue(type + " is not equal to " + typeAtt.Type, type.Equals(typeAtt.Type, StringComparison.Ordinal));
                 count++;
             }
 
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TestTeeSinkTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TestTeeSinkTokenFilter.cs
index e140d2e..835103b 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TestTeeSinkTokenFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TestTeeSinkTokenFilter.cs
@@ -71,7 +71,7 @@ namespace Lucene.Net.Analysis.Sinks
             public override bool Accept(AttributeSource a)
             {
                 ICharTermAttribute termAtt = a.GetAttribute<ICharTermAttribute>();
-                return termAtt.ToString().Equals("The", StringComparison.CurrentCultureIgnoreCase);
+                return termAtt.ToString().Equals("The", StringComparison.OrdinalIgnoreCase);
             }
         }
 
@@ -86,7 +86,7 @@ namespace Lucene.Net.Analysis.Sinks
             public override bool Accept(AttributeSource a)
             {
                 ICharTermAttribute termAtt = a.GetAttribute<ICharTermAttribute>();
-                return termAtt.ToString().Equals("Dogs", StringComparison.CurrentCultureIgnoreCase);
+                return termAtt.ToString().Equals("Dogs", StringComparison.OrdinalIgnoreCase);
             }
         }
 
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenTypeSinkTokenizerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenTypeSinkTokenizerTest.cs
index ab11b89..6c5bf8b 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenTypeSinkTokenizerTest.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenTypeSinkTokenizerTest.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Analysis.TokenAttributes;
 using NUnit.Framework;
+using System;
 using System.IO;
 
 namespace Lucene.Net.Analysis.Sinks
@@ -40,14 +41,14 @@ namespace Lucene.Net.Analysis.Sinks
             ttf.Reset();
             while (ttf.IncrementToken())
             {
-                if (termAtt.ToString().Equals("dogs"))
+                if (termAtt.ToString().Equals("dogs", StringComparison.Ordinal))
                 {
                     seenDogs = true;
-                    assertTrue(typeAtt.Type + " is not equal to " + "D", typeAtt.Type.Equals("D") == true);
+                    assertTrue(typeAtt.Type + " is not equal to " + "D", typeAtt.Type.Equals("D", StringComparison.Ordinal) == true);
                 }
                 else
                 {
-                    assertTrue(typeAtt.Type + " is not null and it should be", typeAtt.Type.Equals("word"));
+                    assertTrue(typeAtt.Type + " is not null and it should be", typeAtt.Type.Equals("word", StringComparison.Ordinal));
                 }
             }
             assertTrue(seenDogs + " does not equal: " + true, seenDogs == true);
@@ -83,7 +84,7 @@ namespace Lucene.Net.Analysis.Sinks
                     return false;
                 }
 
-                if (termAtt.ToString().Equals("dogs"))
+                if (termAtt.ToString().Equals("dogs", StringComparison.Ordinal))
                 {
                     typeAtt.Type = "D";
                 }
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMap.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMap.cs
index d339b4e..da9b243 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMap.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMap.cs
@@ -304,7 +304,7 @@ namespace Lucene.Net.Analysis.Synonym
 
             public Stream OpenResource(string resource)
             {
-                if (!"something.txt".Equals(resource))
+                if (!"something.txt".Equals(resource, StringComparison.Ordinal))
                 {
                     throw new Exception("should not get a differnt resource");
                 }
@@ -321,7 +321,7 @@ namespace Lucene.Net.Analysis.Synonym
             bool inc = false;
             foreach (Token token in tokens)
             {
-                if (exp.Equals(new string(token.Buffer, 0, token.Length)))
+                if (exp.Equals(new string(token.Buffer, 0, token.Length), StringComparison.Ordinal))
                 {
                     inc = true;
                 }
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestBufferedCharFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestBufferedCharFilter.cs
index 029c7d2..dc0d9fd 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestBufferedCharFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestBufferedCharFilter.cs
@@ -129,7 +129,7 @@ namespace Lucene.Net.Analysis.Util
             br.Read(buf, 0, 500);
 
             assertTrue("Failed to set mark properly", testString.Substring(500,
-                    1000 - 500).equals(new string(buf, 0, 500)));
+                    1000 - 500).Equals(new string(buf, 0, 500), StringComparison.Ordinal));
 
             try
             {
@@ -246,8 +246,8 @@ namespace Lucene.Net.Analysis.Util
                 char[] buf = new char[14];
                 @in.Read(buf, 0, 14); // Read greater than the buffer
 
-                assertTrue("Wrong block read data", new String(buf)
-                        .equals(new String(chars, 1, 14)));
+                assertTrue("Wrong block read data", new string(buf)
+                        .Equals(new string(chars, 1, 14), StringComparison.Ordinal));
 
                 assertEquals("Wrong chars", 15, @in.Read()); // Check next byte
             }
@@ -424,8 +424,8 @@ namespace Lucene.Net.Analysis.Util
                 br = new BufferedCharFilter(new StringReader(testString));
                 br.Read(buf, 50, 500);
 
-                assertTrue("Chars read improperly", new String(buf, 50, 500)
-                        .equals(testString.Substring(0, 500 - 0)));
+                assertTrue("Chars read improperly", new string(buf, 50, 500)
+                        .Equals(testString.Substring(0, 500 - 0), StringComparison.Ordinal));
             }
 #pragma warning disable 168
             catch (IOException e)
@@ -768,7 +768,7 @@ namespace Lucene.Net.Analysis.Util
                 char[] buf = new char[testString.Length];
                 br.Read(buf, 0, 500);
                 assertTrue("Failed to reset properly", testString.Substring(500,
-                        1000 - 500).equals(new String(buf, 0, 500)));
+                        1000 - 500).Equals(new string(buf, 0, 500), StringComparison.Ordinal));
             }
 #pragma warning disable 168
             catch (IOException e)
@@ -847,7 +847,7 @@ namespace Lucene.Net.Analysis.Util
                 char[] buf = new char[testString.Length];
                 br.Read(buf, 0, 500);
                 assertTrue("Failed to set skip properly", testString.Substring(500,
-                        1000 - 500).equals(new String(buf, 0, 500)));
+                        1000 - 500).Equals(new string(buf, 0, 500), StringComparison.Ordinal));
             }
 #pragma warning disable 168
             catch (IOException e)
diff --git a/src/Lucene.Net.Tests.Analysis.Phonetic/Language/Bm/BeiderMorseEncoderTest.cs b/src/Lucene.Net.Tests.Analysis.Phonetic/Language/Bm/BeiderMorseEncoderTest.cs
index f85c95c..c0a3ad7 100644
--- a/src/Lucene.Net.Tests.Analysis.Phonetic/Language/Bm/BeiderMorseEncoderTest.cs
+++ b/src/Lucene.Net.Tests.Analysis.Phonetic/Language/Bm/BeiderMorseEncoderTest.cs
@@ -33,7 +33,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language.Bm
 
         private void AssertNotEmpty(BeiderMorseEncoder bmpm, string value)
         {
-            Assert.False(bmpm.Encode(value).Equals(""), value);
+            Assert.False(bmpm.Encode(value).Equals("", StringComparison.Ordinal), value);
         }
 
         private BeiderMorseEncoder CreateGenericApproxEncoder()
diff --git a/src/Lucene.Net.Tests.Analysis.Phonetic/Language/Bm/PhoneticEngineRegressionTest.cs b/src/Lucene.Net.Tests.Analysis.Phonetic/Language/Bm/PhoneticEngineRegressionTest.cs
index 3f89405..f018d45 100644
--- a/src/Lucene.Net.Tests.Analysis.Phonetic/Language/Bm/PhoneticEngineRegressionTest.cs
+++ b/src/Lucene.Net.Tests.Analysis.Phonetic/Language/Bm/PhoneticEngineRegressionTest.cs
@@ -203,7 +203,7 @@ namespace Lucene.Net.Analysis.Phonetic.Language.Bm
             // LanguageSet: defaults to automagic, otherwise a comma-separated list.
             String languageSetArg;
             args.TryGetValue("languageSet", out languageSetArg);
-            if (languageSetArg == null || languageSetArg.equals("auto"))
+            if (languageSetArg == null || languageSetArg.Equals("auto", StringComparison.Ordinal))
             {
                 languageSet = null;
             }
diff --git a/src/Lucene.Net.Tests.Analysis.Stempel/Egothor.Stemmer/TestCompile.cs b/src/Lucene.Net.Tests.Analysis.Stempel/Egothor.Stemmer/TestCompile.cs
index 52ac16f..af3d42b 100644
--- a/src/Lucene.Net.Tests.Analysis.Stempel/Egothor.Stemmer/TestCompile.cs
+++ b/src/Lucene.Net.Tests.Analysis.Stempel/Egothor.Stemmer/TestCompile.cs
@@ -192,7 +192,7 @@ namespace Egothor.Stemmer
                         while (st.HasMoreTokens())
                         {
                             string token = st.NextToken();
-                            if (token.Equals(stem))
+                            if (token.Equals(stem, StringComparison.Ordinal))
                             {
                                 continue;
                             }
diff --git a/src/Lucene.Net.Tests.Benchmark/ByTask/TestPerfTasksLogic.cs b/src/Lucene.Net.Tests.Benchmark/ByTask/TestPerfTasksLogic.cs
index 61d4e83..0ae4480 100644
--- a/src/Lucene.Net.Tests.Benchmark/ByTask/TestPerfTasksLogic.cs
+++ b/src/Lucene.Net.Tests.Benchmark/ByTask/TestPerfTasksLogic.cs
@@ -495,7 +495,7 @@ namespace Lucene.Net.Benchmarks.ByTask
             int totalTokenCount1 = 0;
             foreach (TaskStats stat in stats)
             {
-                if (stat.Task.GetName().Equals("ReadTokens"))
+                if (stat.Task.GetName().Equals("ReadTokens", StringComparison.Ordinal))
                 {
                     totalTokenCount1 += stat.Count;
                 }
@@ -511,7 +511,7 @@ namespace Lucene.Net.Benchmarks.ByTask
 
             foreach (String fieldName in fields)
             {
-                if (fieldName.Equals(DocMaker.ID_FIELD) || fieldName.Equals(DocMaker.DATE_MSEC_FIELD) || fieldName.Equals(DocMaker.TIME_SEC_FIELD))
+                if (fieldName.Equals(DocMaker.ID_FIELD, StringComparison.Ordinal) || fieldName.Equals(DocMaker.DATE_MSEC_FIELD, StringComparison.Ordinal) || fieldName.Equals(DocMaker.TIME_SEC_FIELD, StringComparison.Ordinal))
                 {
                     continue;
                 }
@@ -908,17 +908,17 @@ namespace Lucene.Net.Benchmarks.ByTask
             foreach (TaskStats stats in benchmark.RunData.Points.TaskStats)
             {
                 String taskName = stats.Task.GetName();
-                if (taskName.equals("Rounds"))
+                if (taskName.Equals("Rounds", StringComparison.Ordinal))
                 {
                     assertEquals("Wrong total count!", 20 + 2 * n, stats.Count);
                     nChecked++;
                 }
-                else if (taskName.equals("CreateIndex"))
+                else if (taskName.Equals("CreateIndex", StringComparison.Ordinal))
                 {
                     assertEquals("Wrong count for CreateIndex!", n, stats.Count);
                     nChecked++;
                 }
-                else if (taskName.equals("CloseIndex"))
+                else if (taskName.Equals("CloseIndex", StringComparison.Ordinal))
                 {
                     assertEquals("Wrong count for CloseIndex!", n, stats.Count);
                     nChecked++;
diff --git a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
index 5495ecb..01448f0 100644
--- a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
@@ -303,7 +303,7 @@ namespace Lucene.Net.Facet.Range
                     for (int i = 0; i < drillSideways.Length; i++)
                     {
                         string dim = drillSidewaysDims[i];
-                        if (dim.Equals("field"))
+                        if (dim.Equals("field", StringComparison.Ordinal))
                         {
                             fieldFC = drillSideways[i];
                         }
diff --git a/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs b/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs
index 69a2e35..ed41702 100644
--- a/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs
+++ b/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs
@@ -339,7 +339,7 @@ namespace Lucene.Net.Facet.SortedSet
 
                 foreach (TestDoc doc in testDocs)
                 {
-                    if (doc.content.Equals(searchToken))
+                    if (doc.content.Equals(searchToken, StringComparison.Ordinal))
                     {
                         for (int j = 0; j < numDims; j++)
                         {
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs
index 5500b84..21a793a 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs
@@ -112,7 +112,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             var r = DirectoryReader.Open(dir);
             Assert.AreEqual(3, r.NumDocs, "2 categories plus root should have been committed to the underlying directory");
             var readUserCommitData = r.IndexCommit.UserData;
-            Assert.True("1 2 3".Equals(readUserCommitData["testing"]), "wrong value extracted from commit data");
+            Assert.True("1 2 3".Equals(readUserCommitData["testing"], StringComparison.Ordinal), "wrong value extracted from commit data");
             Assert.NotNull(DirectoryTaxonomyWriter.INDEX_EPOCH + " not found in commitData", readUserCommitData[DirectoryTaxonomyWriter.INDEX_EPOCH]);
             r.Dispose();
 
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs
index 81d5da3..9e6d9df 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs
@@ -576,7 +576,7 @@ namespace Lucene.Net.Facet.Taxonomy
                     bool ischild = true;
                     for (int k = 0; k < ExpectedCategories[i].Length; k++)
                     {
-                        if (!ExpectedCategories[j][k].Equals(ExpectedCategories[i][k]))
+                        if (!ExpectedCategories[j][k].Equals(ExpectedCategories[i][k], StringComparison.Ordinal))
                         {
                             ischild = false;
                             break;
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
index eae9248..8156182 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
@@ -807,7 +807,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
                 foreach (TestDoc doc in testDocs)
                 {
-                    if (doc.content.Equals(searchToken))
+                    if (doc.content.Equals(searchToken, StringComparison.Ordinal))
                     {
                         for (int j = 0; j < numDims; j++)
                         {
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
index d935658..e908143 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
@@ -547,7 +547,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
                 foreach (TestDoc doc in testDocs)
                 {
-                    if (doc.content.Equals(searchToken))
+                    if (doc.content.Equals(searchToken, StringComparison.Ordinal))
                     {
                         for (int j = 0; j < numDims; j++)
                         {
diff --git a/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs b/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs
index 221f815..5e3cf01 100644
--- a/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs
+++ b/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs
@@ -270,7 +270,7 @@ namespace Lucene.Net.Facet
             var clone = q.Clone() as DrillDownQuery;
             Assert.NotNull(clone);
             clone.Add("b");
-            Assert.False(q.ToString().Equals(clone.ToString()), "query wasn't cloned: source=" + q + " clone=" + clone);
+            Assert.False(q.ToString().Equals(clone.ToString(), StringComparison.Ordinal), "query wasn't cloned: source=" + q + " clone=" + clone);
         }
 
         [Test]
diff --git a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
index 068f62b..e7d7c09 100644
--- a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
+++ b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
@@ -682,7 +682,7 @@ namespace Lucene.Net.Facet
                                     string value = dimValues[dim][Random().Next(dimValues[dim].Length)];
                                     for (int j = 0; j < i; j++)
                                     {
-                                        if (value.Equals(drillDowns[dim][j]))
+                                        if (value.Equals(drillDowns[dim][j], StringComparison.Ordinal))
                                         {
                                             value = null;
                                             break;
@@ -1072,7 +1072,7 @@ namespace Lucene.Net.Facet
                 {
                     continue;
                 }
-                if (contentToken == null || doc.contentToken.Equals(contentToken))
+                if (contentToken == null || doc.contentToken.Equals(contentToken, StringComparison.Ordinal))
                 {
                     int failDim = -1;
                     for (int dim = 0; dim < numDims; dim++)
@@ -1084,7 +1084,7 @@ namespace Lucene.Net.Facet
                             bool matches = false;
                             foreach (string value in drillDowns[dim])
                             {
-                                if (value.Equals(docValue) || value.Equals(docValue2))
+                                if (value.Equals(docValue, StringComparison.Ordinal) || value.Equals(docValue2, StringComparison.Ordinal))
                                 {
                                     matches = true;
                                     break;
diff --git a/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs b/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs
index d240cdb..7452c7c 100644
--- a/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs
+++ b/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs
@@ -1216,7 +1216,7 @@ namespace Lucene.Net.Search.Highlight
 
                 String result = highlighter.GetBestFragment(tokenStream, texts[0]).Trim();
                 assertTrue("Failed to find best section using weighted terms. Found: [" + result + "]",
-                    "<B>Hello</B>".equals(result));
+                    "<B>Hello</B>".Equals(result, StringComparison.Ordinal));
 
                 // readjust weights
                 wTerms[1].Weight = (50f);
@@ -1226,7 +1226,7 @@ namespace Lucene.Net.Search.Highlight
 
                 result = highlighter.GetBestFragment(tokenStream, texts[0]).Trim();
                 assertTrue("Failed to find best section using weighted terms. Found: " + result,
-                    "<B>kennedy</B>".equals(result));
+                    "<B>kennedy</B>".Equals(result, StringComparison.Ordinal));
             });
 
             helper.Start();
@@ -1259,7 +1259,7 @@ namespace Lucene.Net.Search.Highlight
                 String result = highlighter.GetBestFragments(tokenStream, s, 3, "...");
                 String expectedResult = "<B>football</B>-<B>soccer</B> in the euro 2004 <B>footie</B> competition";
                 assertTrue("overlapping analyzer should handle highlights OK, expected:" + expectedResult
-                    + " actual:" + result, expectedResult.equals(result));
+                    + " actual:" + result, expectedResult.Equals(result, StringComparison.Ordinal));
             });
 
             helper.Start();
@@ -1319,7 +1319,7 @@ namespace Lucene.Net.Search.Highlight
                     {
                         if (VERBOSE) Console.WriteLine(fragmentResults[j]);
                         assertTrue("Failed to find same text Fragments: " + fragmentResults[j] + " found",
-                            fragmentResults[j].toString().equals(stringResults[j]));
+                            fragmentResults[j].toString().Equals(stringResults[j], StringComparison.Ordinal));
 
                     }
                 }
diff --git a/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs b/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
index 0a3d97d..b96efea 100644
--- a/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
+++ b/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
@@ -1150,7 +1150,7 @@ namespace Lucene.Net.Search.PostingsHighlight
         {
             protected override char GetMultiValuedSeparator(string field)
             {
-                Debug.Assert( field.equals("body"));
+                Debug.Assert( field.Equals("body", StringComparison.Ordinal));
                 return '\u2029';
             }
         }
diff --git a/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs b/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs
index c197693..9a6ccc5 100644
--- a/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs
+++ b/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs
@@ -244,7 +244,7 @@ namespace Lucene.Net.Search.VectorHighlight
                 do
                 {
                     randomValue = TestUtil.RandomSimpleString(Random());
-                } while ("".equals(randomValue));
+                } while ("".Equals(randomValue, StringComparison.Ordinal));
                 randomValues[i] = randomValue;
             }
 
@@ -306,7 +306,7 @@ namespace Lucene.Net.Search.VectorHighlight
                         bool hit = false;
                         for (int i = 0; i < fieldValues.Length; i++)
                         {
-                            if (queryTerm.equals(fieldValues[i]))
+                            if (queryTerm.Equals(fieldValues[i], StringComparison.Ordinal))
                             {
                                 builder.append("<b>").append(queryTerm).append("</b>");
                                 hit = true;
diff --git a/src/Lucene.Net.Tests.Join/TestBlockJoin.cs b/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
index 6ba15f9..bb15c35 100644
--- a/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
+++ b/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
@@ -1112,7 +1112,7 @@ namespace Lucene.Net.Tests.Join
                     while (true)
                     {
                         assertTrue(resultUpto < hits.Length);
-                        if (!parentID.Equals(r.Document(hits[resultUpto].Doc).Get("parentID")))
+                        if (!parentID.Equals(r.Document(hits[resultUpto].Doc).Get("parentID"), StringComparison.Ordinal))
                         {
                             break;
                         }
diff --git a/src/Lucene.Net.Tests.Join/TestJoinUtil.cs b/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
index 82057a7..dc7aef4 100644
--- a/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
+++ b/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
@@ -591,7 +591,7 @@ namespace Lucene.Net.Tests.Join
                 {
                     uniqueRandomValue = TestUtil.RandomRealisticUnicodeString(Random());
                     //        uniqueRandomValue = TestUtil.randomSimpleString(random);
-                } while ("".Equals(uniqueRandomValue) || trackSet.Contains(uniqueRandomValue));
+                } while ("".Equals(uniqueRandomValue, StringComparison.Ordinal) || trackSet.Contains(uniqueRandomValue));
                 // Generate unique values and empty strings aren't allowed.
                 trackSet.Add(uniqueRandomValue);
                 context.RandomFrom[i] = Random().NextBoolean();
diff --git a/src/Lucene.Net.Tests.Misc/Document/TestLazyDocument.cs b/src/Lucene.Net.Tests.Misc/Document/TestLazyDocument.cs
index 06c74de..b71e345 100644
--- a/src/Lucene.Net.Tests.Misc/Document/TestLazyDocument.cs
+++ b/src/Lucene.Net.Tests.Misc/Document/TestLazyDocument.cs
@@ -114,15 +114,15 @@ namespace Lucene.Net.Documents
                 foreach (IIndexableField f in d)
                 {
                     numFieldValues++;
-                    if (f.Name.equals("never_load"))
+                    if (f.Name.Equals("never_load", StringComparison.Ordinal))
                     {
                         fail("never_load was loaded");
                     }
-                    if (f.Name.equals("load_later"))
+                    if (f.Name.Equals("load_later", StringComparison.Ordinal))
                     {
                         fail("load_later was loaded on first pass");
                     }
-                    if (f.Name.equals("docid"))
+                    if (f.Name.Equals("docid", StringComparison.Ordinal))
                     {
                         assertFalse(f.Name, f is LazyDocument.LazyField);
                     }
@@ -160,15 +160,15 @@ namespace Lucene.Net.Documents
                 // now every value of fieldName should be loaded
                 foreach (IIndexableField f in d)
                 {
-                    if (f.Name.equals("never_load"))
+                    if (f.Name.Equals("never_load", StringComparison.Ordinal))
                     {
                         fail("never_load was loaded");
                     }
-                    if (f.Name.equals("load_later"))
+                    if (f.Name.Equals("load_later", StringComparison.Ordinal))
                     {
                         fail("load_later was loaded too soon");
                     }
-                    if (f.Name.equals("docid"))
+                    if (f.Name.Equals("docid", StringComparison.Ordinal))
                     {
                         assertFalse(f.Name, f is LazyDocument.LazyField);
                     }
@@ -178,7 +178,7 @@ namespace Lucene.Net.Documents
                                    f is LazyDocument.LazyField);
                         LazyDocument.LazyField lf = (LazyDocument.LazyField)f;
                         assertEquals(f.Name + " is loaded?",
-                                     lf.Name.equals(fieldName), lf.HasBeenLoaded);
+                                     lf.Name.Equals(fieldName, StringComparison.Ordinal), lf.HasBeenLoaded);
                     }
                 }
 
@@ -193,11 +193,11 @@ namespace Lucene.Net.Documents
                 // we already loaded.
                 foreach (IIndexableField f in d)
                 {
-                    if (f.Name.equals("never_load"))
+                    if (f.Name.Equals("never_load", StringComparison.Ordinal))
                     {
                         fail("never_load was loaded");
                     }
-                    if (f.Name.equals("docid"))
+                    if (f.Name.Equals("docid", StringComparison.Ordinal))
                     {
                         assertFalse(f.Name, f is LazyDocument.LazyField);
                     }
@@ -207,7 +207,7 @@ namespace Lucene.Net.Documents
                                    f is LazyDocument.LazyField);
                         LazyDocument.LazyField lf = (LazyDocument.LazyField)f;
                         assertEquals(f.Name + " is loaded?",
-                                     lf.Name.equals(fieldName), lf.HasBeenLoaded);
+                                     lf.Name.Equals(fieldName, StringComparison.Ordinal), lf.HasBeenLoaded);
                     }
                 }
 
@@ -237,11 +237,11 @@ namespace Lucene.Net.Documents
 
             public override Status NeedsField(FieldInfo fieldInfo)
             {
-                if (fieldInfo.Name.equals("docid"))
+                if (fieldInfo.Name.Equals("docid", StringComparison.Ordinal))
                 {
                     return Status.YES;
                 }
-                else if (fieldInfo.Name.equals("never_load"))
+                else if (fieldInfo.Name.Equals("never_load", StringComparison.Ordinal))
                 {
                     return Status.NO;
                 }
diff --git a/src/Lucene.Net.Tests.Misc/Index/Sorter/SorterTestBase.cs b/src/Lucene.Net.Tests.Misc/Index/Sorter/SorterTestBase.cs
index ce9e862..5e8c043 100644
--- a/src/Lucene.Net.Tests.Misc/Index/Sorter/SorterTestBase.cs
+++ b/src/Lucene.Net.Tests.Misc/Index/Sorter/SorterTestBase.cs
@@ -49,7 +49,7 @@ namespace Lucene.Net.Index.Sorter
 
             public override long ComputeNorm(FieldInvertState state)
             {
-                if (state.Name.Equals(NORMS_FIELD))
+                if (state.Name.Equals(NORMS_FIELD, StringComparison.Ordinal))
                 {
                     return Number.SingleToInt32Bits(state.Boost);
                 }
diff --git a/src/Lucene.Net.Tests.Misc/Misc/SweetSpotSimilarityTest.cs b/src/Lucene.Net.Tests.Misc/Misc/SweetSpotSimilarityTest.cs
index f74274d..76e66db 100644
--- a/src/Lucene.Net.Tests.Misc/Misc/SweetSpotSimilarityTest.cs
+++ b/src/Lucene.Net.Tests.Misc/Misc/SweetSpotSimilarityTest.cs
@@ -216,13 +216,13 @@ namespace Lucene.Net.Misc
 
             public override Similarity Get(string field)
             {
-                if (field.Equals("bar"))
+                if (field.Equals("bar", StringComparison.Ordinal))
                     return ssBar;
-                else if (field.Equals("yak"))
+                else if (field.Equals("yak", StringComparison.Ordinal))
                     return ssYak;
-                else if (field.Equals("a"))
+                else if (field.Equals("a", StringComparison.Ordinal))
                     return ssA;
-                else if (field.Equals("b"))
+                else if (field.Equals("b", StringComparison.Ordinal))
                     return ssB;
                 else
                     return ss;
diff --git a/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs b/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
index fc80980..6ff04c2 100644
--- a/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
+++ b/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
@@ -556,7 +556,7 @@ namespace Lucene.Net.Tests.Queries
             protected override Query NewTermQuery(Term term, TermContext context)
             {
                 Query query = base.NewTermQuery(term, context);
-                if (term.Text().Equals(@"universe"))
+                if (term.Text().Equals(@"universe", StringComparison.Ordinal))
                 {
                     query.Boost = 100F;
                 }
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
index d980ffa..05be2f0 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
@@ -25,6 +25,7 @@ using Lucene.Net.Queries.Function.ValueSources;
 using Lucene.Net.Search;
 using Lucene.Net.Support;
 using NUnit.Framework;
+using System;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
@@ -160,7 +161,7 @@ namespace Lucene.Net.Tests.Queries.Function
                 float expectedScore = N_DOCS - i - 1;
                 assertEquals("score of result " + i + " shuould be " + expectedScore + " != " + score, expectedScore, score, TEST_SCORE_TOLERANCE_DELTA);
                 string expectedId = inOrder ? Id2String(N_DOCS - i) : Id2String(i + 1); // reverse  ==> smaller values first -  in-order ==> larger  values first
-                assertTrue("id of result " + i + " shuould be " + expectedId + " != " + score, expectedId.Equals(id));
+                assertTrue("id of result " + i + " shuould be " + expectedId + " != " + score, expectedId.Equals(id, StringComparison.Ordinal));
             }
             r.Dispose();
         }
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
index f01635d..82ba132 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
@@ -299,7 +299,7 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestSumTotalTermFreq()
         {
-            if (Codec.Default.Name.Equals("Lucene3x"))
+            if (Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal))
             {
                 AssertHits(new FunctionQuery(new SumTotalTermFreqValueSource("text")), new[] { -1f, -1f });
             }
@@ -336,7 +336,7 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestTotalTermFreq()
         {
-            if (Codec.Default.Name.Equals("Lucene3x"))
+            if (Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal))
             {
                 AssertHits(new FunctionQuery(new TotalTermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))), new[] { -1f, -1f });
             }
diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs
index 48d86aa..a9d5c55 100644
--- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs
@@ -182,12 +182,12 @@ namespace Lucene.Net.QueryParsers.Classic
                     prevStartOffset = offsetAtt.StartOffset;
                     prevEndOffset = offsetAtt.EndOffset;
                     string text = termAtt.toString();
-                    if (text.equals("triplemulti"))
+                    if (text.Equals("triplemulti", StringComparison.Ordinal))
                     {
                         multiToken = 2;
                         return true;
                     }
-                    else if (text.equals("multi"))
+                    else if (text.Equals("multi", StringComparison.Ordinal))
                     {
                         multiToken = 1;
                         return true;
@@ -237,11 +237,11 @@ namespace Lucene.Net.QueryParsers.Classic
             {
                 while (m_input.IncrementToken())
                 {
-                    if (termAtt.toString().equals("the"))
+                    if (termAtt.toString().Equals("the", StringComparison.Ordinal))
                     {
                         // stopword, do nothing
                     }
-                    else if (termAtt.toString().equals("quick"))
+                    else if (termAtt.toString().Equals("quick", StringComparison.Ordinal))
                     {
                         posIncrAtt.PositionIncrement = (2);
                         return true;
diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs
index a48ea0b..f7dc3c7 100644
--- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs
@@ -342,7 +342,7 @@ namespace Lucene.Net.QueryParsers.Classic
 
             protected internal override System.IO.TextReader InitReader(string fieldName, TextReader reader)
             {
-                if ("f1".equals(fieldName))
+                if ("f1".Equals(fieldName, StringComparison.Ordinal))
                 {
                     // we don't use the reader, so close it:
                     IOUtils.DisposeWhileHandlingException(reader);
diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
index 5fc0517..97bff7c 100644
--- a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
@@ -420,7 +420,7 @@ namespace Lucene.Net.QueryParsers.Classic
 
                 if (m_input.IncrementToken())
                 {
-                    AddSynonym = TermAtt.ToString().Equals("国");
+                    AddSynonym = TermAtt.ToString().Equals("国", StringComparison.Ordinal);
                     return true;
                 }
                 else
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
index 5b50ec5..296076b 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
@@ -94,7 +94,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
                 }
                 else
                     while (m_input.IncrementToken())
-                        if (termAtt.toString().equals("phrase"))
+                        if (termAtt.toString().Equals("phrase", StringComparison.Ordinal))
                         {
                             inPhrase = true;
                             savedStart = offsetAtt.StartOffset;
@@ -103,7 +103,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
                             offsetAtt.SetOffset(savedStart, savedEnd);
                             return true;
                         }
-                        else if (!termAtt.toString().equals("stop"))
+                        else if (!termAtt.toString().Equals("stop", StringComparison.Ordinal))
                             return true;
                 return false;
             }
@@ -158,7 +158,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
         {
             Query q = GetQuery(query, a);
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s + "/, expecting /" + result
                     + "/");
@@ -172,7 +172,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
             qp.LowercaseExpandedTerms = (lowercase);
             Query q = qp.Parse(query, "field");
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("WildcardQuery /" + query + "/ yielded /" + s + "/, expecting /"
                     + result + "/");
@@ -184,7 +184,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
             PrecedenceQueryParser qp = GetParser(null);
             Query q = qp.Parse(query, "field");
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("WildcardQuery /" + query + "/ yielded /" + s + "/, expecting /"
                     + result + "/");
@@ -205,7 +205,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
         {
             Query q = getQueryDOA(query, a);
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s + "/, expecting /" + result
                     + "/");
@@ -531,7 +531,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
         {
             Query q = qp.Parse(query, field);
             String s = q.ToString(field);
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s + "/, expecting /" + result
                     + "/");
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/UniqueFieldAttributeImpl.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/UniqueFieldAttributeImpl.cs
index 5a4c3d7..d33b44d 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/UniqueFieldAttributeImpl.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/UniqueFieldAttributeImpl.cs
@@ -65,7 +65,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Spans
             {
 
                 return ((UniqueFieldAttribute)other).uniqueField
-                    .equals(this.uniqueField);
+                    .Equals(this.uniqueField, System.StringComparison.Ordinal);
             }
 
             return false;
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiAnalyzerQPHelper.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiAnalyzerQPHelper.cs
index 72d4cd3..7487944 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiAnalyzerQPHelper.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiAnalyzerQPHelper.cs
@@ -201,12 +201,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
                     prevStartOffset = offsetAtt.StartOffset;
                     prevEndOffset = offsetAtt.EndOffset;
                     String text = termAtt.toString();
-                    if (text.equals("triplemulti"))
+                    if (text.Equals("triplemulti", StringComparison.Ordinal))
                     {
                         multiToken = 2;
                         return true;
                     }
-                    else if (text.equals("multi"))
+                    else if (text.Equals("multi", StringComparison.Ordinal))
                     {
                         multiToken = 1;
                         return true;
@@ -261,11 +261,11 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             {
                 while (m_input.IncrementToken())
                 {
-                    if (termAtt.toString().equals("the"))
+                    if (termAtt.toString().Equals("the", StringComparison.Ordinal))
                     {
                         // stopword, do nothing
                     }
-                    else if (termAtt.toString().equals("quick"))
+                    else if (termAtt.toString().Equals("quick", StringComparison.Ordinal))
                     {
                         posIncrAtt.PositionIncrement = (2);
                         return true;
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs
index 030678b..0bd8282 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs
@@ -409,7 +409,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
 
             protected internal override TextReader InitReader(String fieldName, TextReader reader)
             {
-                if ("f1".equals(fieldName))
+                if ("f1".Equals(fieldName, StringComparison.Ordinal))
                 {
                     // we don't use the reader, so close it:
                     IOUtils.DisposeWhileHandlingException(reader);
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs
index 0b27cd6..103db56 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs
@@ -276,23 +276,23 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
                     /*Number*/
                     object number = RANDOM_NUMBER_MAP[fieldName];
 
-                    if (NumericType.INT64.ToString().equals(fieldName)
-                        || DATE_FIELD_NAME.equals(fieldName))
+                    if (NumericType.INT64.ToString().Equals(fieldName, StringComparison.Ordinal)
+                        || DATE_FIELD_NAME.Equals(fieldName, StringComparison.Ordinal))
                     {
                         number = -Convert.ToInt64(number);
 
                     }
-                    else if (NumericType.DOUBLE.ToString().equals(fieldName))
+                    else if (NumericType.DOUBLE.ToString().Equals(fieldName, StringComparison.Ordinal))
                     {
                         number = -Convert.ToDouble(number);
 
                     }
-                    else if (NumericType.SINGLE.ToString().equals(fieldName))
+                    else if (NumericType.SINGLE.ToString().Equals(fieldName, StringComparison.Ordinal))
                     {
                         number = -Convert.ToSingle(number);
 
                     }
-                    else if (NumericType.INT32.ToString().equals(fieldName))
+                    else if (NumericType.INT32.ToString().Equals(fieldName, StringComparison.Ordinal))
                     {
                         number = -Convert.ToInt32(number);
 
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
index 3fb4953..bdbbb61 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
@@ -98,7 +98,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
                 else
                     while (m_input.IncrementToken())
                     {
-                        if (termAtt.toString().equals("phrase"))
+                        if (termAtt.toString().Equals("phrase", StringComparison.Ordinal))
                         {
                             inPhrase = true;
                             savedStart = offsetAtt.StartOffset;
@@ -107,7 +107,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
                             offsetAtt.SetOffset(savedStart, savedEnd);
                             return true;
                         }
-                        else if (!termAtt.toString().equals("stop"))
+                        else if (!termAtt.toString().Equals("stop", StringComparison.Ordinal))
                             return true;
                     }
                 return false;
@@ -223,7 +223,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
         {
             Query q = GetQuery(query, a);
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s + "/, expecting /" + result
                     + "/");
@@ -234,7 +234,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
         {
             Query q = GetQueryAllowLeadingWildcard(query, a);
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s + "/, expecting /" + result
                     + "/");
@@ -246,7 +246,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
         {
             Query q = qp.Parse(query, field);
             String s = q.ToString(field);
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s + "/, expecting /" + result
                     + "/");
@@ -256,7 +256,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
         public void AssertEscapedQueryEquals(String query, Analyzer a, String result)
         {
             String escapedQuery = QueryParserUtil.Escape(query);
-            if (!escapedQuery.equals(result))
+            if (!escapedQuery.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + escapedQuery + "/, expecting /"
                     + result + "/");
@@ -271,7 +271,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             qp.AllowLeadingWildcard = (allowLeadingWildcard);
             Query q = qp.Parse(query, "field");
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("WildcardQuery /" + query + "/ yielded /" + s + "/, expecting /"
                     + result + "/");
@@ -289,7 +289,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             StandardQueryParser qp = GetParser(null);
             Query q = qp.Parse(query, "field");
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("WildcardQuery /" + query + "/ yielded /" + s + "/, expecting /"
                     + result + "/");
@@ -312,7 +312,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
         {
             Query q = GetQueryDOA(query, a);
             String s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s + "/, expecting /" + result
                     + "/");
diff --git a/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs b/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs
index dee6193..bafc6a1 100644
--- a/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs
@@ -93,7 +93,7 @@ namespace Lucene.Net.QueryParsers.Util
                 else
                     while (m_input.IncrementToken())
                     {
-                        if (termAtt.toString().Equals("phrase"))
+                        if (termAtt.toString().Equals("phrase", StringComparison.Ordinal))
                         {
                             inPhrase = true;
                             savedStart = offsetAtt.StartOffset;
@@ -102,7 +102,7 @@ namespace Lucene.Net.QueryParsers.Util
                             offsetAtt.SetOffset(savedStart, savedEnd);
                             return true;
                         }
-                        else if (!termAtt.toString().equals("stop"))
+                        else if (!termAtt.toString().Equals("stop", StringComparison.Ordinal))
                             return true;
                     }
                 return false;
@@ -159,7 +159,7 @@ namespace Lucene.Net.QueryParsers.Util
         {
             Query q = GetQuery(query, a);
             string s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s
                      + "/, expecting /" + result + "/");
@@ -170,7 +170,7 @@ namespace Lucene.Net.QueryParsers.Util
         {
             Query q = GetQuery(query, cqpC);
             string s = q.ToString(field);
-            if (!s.Equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s
                      + "/, expecting /" + result + "/");
@@ -180,7 +180,7 @@ namespace Lucene.Net.QueryParsers.Util
         public void AssertEscapedQueryEquals(string query, Analyzer a, string result)
         {
             string escapedQuery = QueryParserBase.Escape(query);
-            if (!escapedQuery.Equals(result))
+            if (!escapedQuery.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + escapedQuery
                     + "/, expecting /" + result + "/");
@@ -194,7 +194,7 @@ namespace Lucene.Net.QueryParsers.Util
             cqpC.AllowLeadingWildcard = allowLeadingWildcard;
             Query q = GetQuery(query, cqpC);
             string s = q.ToString("field");
-            if (!s.equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("WildcardQuery /" + query + "/ yielded /" + s
                      + "/, expecting /" + result + "/");
@@ -210,7 +210,7 @@ namespace Lucene.Net.QueryParsers.Util
         {
             Query q = GetQuery(query);
             string s = q.ToString("field");
-            if (!s.Equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("WildcardQuery /" + query + "/ yielded /" + s + "/, expecting /"
                     + result + "/");
@@ -230,7 +230,7 @@ namespace Lucene.Net.QueryParsers.Util
         {
             Query q = GetQueryDOA(query, a);
             string s = q.ToString("field");
-            if (!s.Equals(result))
+            if (!s.Equals(result, StringComparison.Ordinal))
             {
                 fail("Query /" + query + "/ yielded /" + s
                      + "/, expecting /" + result + "/");
@@ -1235,7 +1235,7 @@ namespace Lucene.Net.QueryParsers.Util
 
                 if (m_input.IncrementToken())
                 {
-                    addSynonym = termAtt.toString().equals("dogs");
+                    addSynonym = termAtt.toString().Equals("dogs", StringComparison.Ordinal);
                     return true;
                 }
                 else
diff --git a/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs b/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs
index 9290a5c..46d8d73 100644
--- a/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs
+++ b/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs
@@ -120,7 +120,7 @@ namespace Lucene.Net.Replicator
                 foreach (var files in sourceFiles.Values)
                 {
                     string lastFile = files.Last().FileName;
-                    assertTrue(lastFile.StartsWith(IndexFileNames.SEGMENTS, StringComparison.Ordinal) && !lastFile.Equals(IndexFileNames.SEGMENTS_GEN));
+                    assertTrue(lastFile.StartsWith(IndexFileNames.SEGMENTS, StringComparison.Ordinal) && !lastFile.Equals(IndexFileNames.SEGMENTS_GEN, StringComparison.Ordinal));
                 }
             }
             finally
@@ -148,7 +148,7 @@ namespace Lucene.Net.Replicator
                 foreach (var e in rev.SourceFiles)
                 {
                     string source = e.Key;
-                    Directory dir = source.Equals(IndexAndTaxonomyRevision.INDEX_SOURCE) ? indexDir : taxoDir;
+                    Directory dir = source.Equals(IndexAndTaxonomyRevision.INDEX_SOURCE, StringComparison.Ordinal) ? indexDir : taxoDir;
                     foreach (RevisionFile file in e.Value)
                     {
                         IndexInput src = dir.OpenInput(file.FileName, IOContext.READ_ONCE);
diff --git a/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs b/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs
index cea6e51..a639e59 100644
--- a/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs
+++ b/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs
@@ -118,7 +118,7 @@ namespace Lucene.Net.Replicator
                 assertEquals(1, sourceFiles.Count);
                 var files = sourceFiles.Values.First();
                 string lastFile = files.Last().FileName;
-                assertTrue(lastFile.StartsWith(IndexFileNames.SEGMENTS, StringComparison.Ordinal) && !lastFile.Equals(IndexFileNames.SEGMENTS_GEN));
+                assertTrue(lastFile.StartsWith(IndexFileNames.SEGMENTS, StringComparison.Ordinal) && !lastFile.Equals(IndexFileNames.SEGMENTS_GEN, StringComparison.Ordinal));
             }
             finally
             {
diff --git a/src/Lucene.Net.Tests.Spatial/TestTestFramework.cs b/src/Lucene.Net.Tests.Spatial/TestTestFramework.cs
index 6c36de0..67a4242 100644
--- a/src/Lucene.Net.Tests.Spatial/TestTestFramework.cs
+++ b/src/Lucene.Net.Tests.Spatial/TestTestFramework.cs
@@ -48,7 +48,7 @@ namespace Lucene.Net.Spatial
             SpatialTestQuery sf = tests[0];
             // assert
             assertEquals(1, sf.ids.size());
-            assertTrue(sf.ids[0].equals("G5391959"));
+            assertTrue(sf.ids[0].Equals("G5391959", StringComparison.Ordinal));
             assertTrue(sf.args.Shape is IRectangle);
             assertEquals(SpatialOperation.Intersects, sf.args.Operation);
         }
diff --git a/src/Lucene.Net.Tests.Suggest/Spell/TestDirectSpellChecker.cs b/src/Lucene.Net.Tests.Suggest/Spell/TestDirectSpellChecker.cs
index b1ecae0..5f0619d 100644
--- a/src/Lucene.Net.Tests.Suggest/Spell/TestDirectSpellChecker.cs
+++ b/src/Lucene.Net.Tests.Suggest/Spell/TestDirectSpellChecker.cs
@@ -87,7 +87,7 @@ namespace Lucene.Net.Search.Spell
                     SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX);
             if (similar.Length > 0)
             {
-                assertFalse(similar[0].String.equals("five")); // don't suggest a word for itself
+                assertFalse(similar[0].String.Equals("five", StringComparison.Ordinal)); // don't suggest a word for itself
             }
 
             similar = spellChecker.SuggestSimilar(new Term("numbers", "fvie"), 2, ir,
diff --git a/src/Lucene.Net.Tests.Suggest/Spell/TestLuceneDictionary.cs b/src/Lucene.Net.Tests.Suggest/Spell/TestLuceneDictionary.cs
index d86bbdb..2d3e75b 100644
--- a/src/Lucene.Net.Tests.Suggest/Spell/TestLuceneDictionary.cs
+++ b/src/Lucene.Net.Tests.Suggest/Spell/TestLuceneDictionary.cs
@@ -4,6 +4,7 @@ using Lucene.Net.Index;
 using Lucene.Net.Store;
 using Lucene.Net.Util;
 using NUnit.Framework;
+using System;
 
 namespace Lucene.Net.Search.Spell
 {
@@ -107,7 +108,7 @@ namespace Lucene.Net.Search.Spell
                 ld = new LuceneDictionary(indexReader, "aaa");
                 it = ld.GetEntryIterator();
                 assertNotNull("First element doesn't exist.", spare = it.Next());
-                assertTrue("First element isn't correct", spare.Utf8ToString().equals("foo"));
+                assertTrue("First element isn't correct", spare.Utf8ToString().Equals("foo", StringComparison.Ordinal));
                 assertNull("More elements than expected", it.Next());
             }
             finally
@@ -127,9 +128,9 @@ namespace Lucene.Net.Search.Spell
                 it = ld.GetEntryIterator();
 
                 assertNotNull("First element doesn't exist.", spare = it.Next());
-                assertTrue("First element isn't correct", spare.Utf8ToString().equals("Jerry"));
+                assertTrue("First element isn't correct", spare.Utf8ToString().Equals("Jerry", StringComparison.Ordinal));
                 assertNotNull("Second element doesn't exist.", spare = it.Next());
-                assertTrue("Second element isn't correct", spare.Utf8ToString().equals("Tom"));
+                assertTrue("Second element isn't correct", spare.Utf8ToString().Equals("Tom", StringComparison.Ordinal));
                 assertNull("More elements than expected", it.Next());
 
                 ld = new LuceneDictionary(indexReader, "contents");
diff --git a/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs b/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs
index 624690f..8b96137 100644
--- a/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs
+++ b/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs
@@ -268,7 +268,7 @@ namespace Lucene.Net.Search.Spell
             similar = spellChecker.SuggestSimilar("five", 2);
             if (similar.Length > 0)
             {
-                assertFalse(similar[0].equals("five")); // don't suggest a word for itself
+                assertFalse(similar[0].Equals("five", StringComparison.Ordinal)); // don't suggest a word for itself
             }
 
             similar = spellChecker.SuggestSimilar("fiv", 2);
diff --git a/src/Lucene.Net.Tests.Suggest/Spell/TestWordBreakSpellChecker.cs b/src/Lucene.Net.Tests.Suggest/Spell/TestWordBreakSpellChecker.cs
index f7bc90e..fd1e2e4 100644
--- a/src/Lucene.Net.Tests.Suggest/Spell/TestWordBreakSpellChecker.cs
+++ b/src/Lucene.Net.Tests.Suggest/Spell/TestWordBreakSpellChecker.cs
@@ -103,19 +103,19 @@ namespace Lucene.Net.Search.Spell
                     assertTrue(cs[0].OriginalTermIndexes.Length == 2);
                     assertTrue(cs[0].OriginalTermIndexes[0] == 1);
                     assertTrue(cs[0].OriginalTermIndexes[1] == 2);
-                    assertTrue(cs[0].Suggestion.String.equals("hundred"));
+                    assertTrue(cs[0].Suggestion.String.Equals("hundred", StringComparison.Ordinal));
                     assertTrue(cs[0].Suggestion.Score == 1);
 
                     assertTrue(cs[1].OriginalTermIndexes.Length == 2);
                     assertTrue(cs[1].OriginalTermIndexes[0] == 3);
                     assertTrue(cs[1].OriginalTermIndexes[1] == 4);
-                    assertTrue(cs[1].Suggestion.String.equals("eighty"));
+                    assertTrue(cs[1].Suggestion.String.Equals("eighty", StringComparison.Ordinal));
                     assertTrue(cs[1].Suggestion.Score == 1);
 
                     assertTrue(cs[2].OriginalTermIndexes.Length == 2);
                     assertTrue(cs[2].OriginalTermIndexes[0] == 4);
                     assertTrue(cs[2].OriginalTermIndexes[1] == 5);
-                    assertTrue(cs[2].Suggestion.String.equals("yeight"));
+                    assertTrue(cs[2].Suggestion.String.Equals("yeight", StringComparison.Ordinal));
                     assertTrue(cs[2].Suggestion.Score == 1);
 
                     for (int i = 3; i < 5; i++)
@@ -126,11 +126,11 @@ namespace Lucene.Net.Search.Spell
                             (cs[i].OriginalTermIndexes[0] == 1 &&
                              cs[i].OriginalTermIndexes[1] == 2 &&
                              cs[i].OriginalTermIndexes[2] == 3 &&
-                             cs[i].Suggestion.String.equals("hundredeight")) ||
+                             cs[i].Suggestion.String.Equals("hundredeight", StringComparison.Ordinal)) ||
                             (cs[i].OriginalTermIndexes[0] == 3 &&
                              cs[i].OriginalTermIndexes[1] == 4 &&
                              cs[i].OriginalTermIndexes[2] == 5 &&
-                             cs[i].Suggestion.String.equals("eightyeight"))
+                             cs[i].Suggestion.String.Equals("eightyeight", StringComparison.Ordinal))
                  );
                     }
 
@@ -140,7 +140,7 @@ namespace Lucene.Net.Search.Spell
                     assertTrue(cs[0].Suggestion.Score == 1);
                     assertTrue(cs[0].OriginalTermIndexes[0] == 1);
                     assertTrue(cs[0].OriginalTermIndexes[1] == 2);
-                    assertTrue(cs[0].Suggestion.String.equals("hundred"));
+                    assertTrue(cs[0].Suggestion.String.Equals("hundred", StringComparison.Ordinal));
                     assertTrue(cs[0].Suggestion.Score == 1);
 
                     assertTrue(cs[1].OriginalTermIndexes.Length == 3);
@@ -148,7 +148,7 @@ namespace Lucene.Net.Search.Spell
                     assertTrue(cs[1].OriginalTermIndexes[0] == 1);
                     assertTrue(cs[1].OriginalTermIndexes[1] == 2);
                     assertTrue(cs[1].OriginalTermIndexes[2] == 3);
-                    assertTrue(cs[1].Suggestion.String.equals("hundredeight"));
+                    assertTrue(cs[1].Suggestion.String.Equals("hundredeight", StringComparison.Ordinal));
                 }
             }
             catch (Exception e)
@@ -178,8 +178,8 @@ namespace Lucene.Net.Search.Spell
                     SuggestWord[][] sw = wbsp.SuggestWordBreaks(term, 5, ir, SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX, WordBreakSpellChecker.BreakSuggestionSortMethod.NUM_CHANGES_THEN_MAX_FREQUENCY);
                     assertTrue(sw.Length == 1);
                     assertTrue(sw[0].Length == 2);
-                    assertTrue(sw[0][0].String.equals("ninety"));
-                    assertTrue(sw[0][1].String.equals("nine"));
+                    assertTrue(sw[0][0].String.Equals("ninety", StringComparison.Ordinal));
+                    assertTrue(sw[0][1].String.Equals("nine", StringComparison.Ordinal));
                     assertTrue(sw[0][0].Score == 1);
                     assertTrue(sw[0][1].Score == 1);
                 }
@@ -191,8 +191,8 @@ namespace Lucene.Net.Search.Spell
                     SuggestWord[][] sw = wbsp.SuggestWordBreaks(term, 2, ir, SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX, WordBreakSpellChecker.BreakSuggestionSortMethod.NUM_CHANGES_THEN_MAX_FREQUENCY);
                     assertTrue(sw.Length == 1);
                     assertTrue(sw[0].Length == 2);
-                    assertTrue(sw[0][0].String.equals("one"));
-                    assertTrue(sw[0][1].String.equals("thousand"));
+                    assertTrue(sw[0][0].String.Equals("one", StringComparison.Ordinal));
+                    assertTrue(sw[0][1].String.Equals("thousand", StringComparison.Ordinal));
                     assertTrue(sw[0][0].Score == 1);
                     assertTrue(sw[0][1].Score == 1);
 
@@ -213,16 +213,16 @@ namespace Lucene.Net.Search.Spell
                     sw = wbsp.SuggestWordBreaks(term, 2, ir, SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX, WordBreakSpellChecker.BreakSuggestionSortMethod.NUM_CHANGES_THEN_MAX_FREQUENCY);
                     assertTrue(sw.Length == 2);
                     assertTrue(sw[0].Length == 2);
-                    assertTrue(sw[0][0].String.equals("one"));
-                    assertTrue(sw[0][1].String.equals("thousand"));
+                    assertTrue(sw[0][0].String.Equals("one", StringComparison.Ordinal));
+                    assertTrue(sw[0][1].String.Equals("thousand", StringComparison.Ordinal));
                     assertTrue(sw[0][0].Score == 1);
                     assertTrue(sw[0][1].Score == 1);
                     assertTrue(sw[0][1].Freq > 1);
                     assertTrue(sw[0][0].Freq > sw[0][1].Freq);
                     assertTrue(sw[1].Length == 3);
-                    assertTrue(sw[1][0].String.equals("one"));
-                    assertTrue(sw[1][1].String.equals("thou"));
-                    assertTrue(sw[1][2].String.equals("sand"));
+                    assertTrue(sw[1][0].String.Equals("one", StringComparison.Ordinal));
+                    assertTrue(sw[1][1].String.Equals("thou", StringComparison.Ordinal));
+                    assertTrue(sw[1][2].String.Equals("sand", StringComparison.Ordinal));
                     assertTrue(sw[1][0].Score == 2);
                     assertTrue(sw[1][1].Score == 2);
                     assertTrue(sw[1][2].Score == 2);
@@ -247,10 +247,10 @@ namespace Lucene.Net.Search.Spell
                     sw = wbsp.SuggestWordBreaks(term, 5, ir, SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX, WordBreakSpellChecker.BreakSuggestionSortMethod.NUM_CHANGES_THEN_MAX_FREQUENCY);
                     assertTrue(sw.Length == 2);
                     assertTrue(sw[0].Length == 5);
-                    assertTrue(sw[0][1].String.equals("thousand"));
+                    assertTrue(sw[0][1].String.Equals("thousand", StringComparison.Ordinal));
                     assertTrue(sw[1].Length == 6);
-                    assertTrue(sw[1][1].String.equals("thou"));
-                    assertTrue(sw[1][2].String.equals("sand"));
+                    assertTrue(sw[1][1].String.Equals("thou", StringComparison.Ordinal));
+                    assertTrue(sw[1][2].String.Equals("sand", StringComparison.Ordinal));
                 }
                 {
                     //make sure we can handle 2-char codepoints
@@ -344,7 +344,7 @@ namespace Lucene.Net.Search.Spell
                         foreach (SuggestWord[] sw1 in sw)
                         {
                             assertTrue(sw1.Length == 2);
-                            if (sw1[0].String.equals(left) && sw1[1].String.equals(right))
+                            if (sw1[0].String.Equals(left, StringComparison.Ordinal) && sw1[1].String.Equals(right, StringComparison.Ordinal))
                             {
                                 failed = false;
                             }
@@ -361,7 +361,7 @@ namespace Lucene.Net.Search.Spell
                         foreach (CombineSuggestion cs1 in cs)
                         {
                             assertTrue(cs1.OriginalTermIndexes.Length == 2);
-                            if (cs1.Suggestion.String.equals(left + right))
+                            if (cs1.Suggestion.String.Equals(left + right, StringComparison.Ordinal))
                             {
                                 failed = false;
                             }
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingSuggesterTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingSuggesterTest.cs
index 3d75293..29b886d 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingSuggesterTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/AnalyzingSuggesterTest.cs
@@ -962,7 +962,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
                 while (true)
                 {
                     string s = Regex.Replace(analyzedKey, SEP + "$", "");
-                    if (s.equals(analyzedKey))
+                    if (s.Equals(analyzedKey, StringComparison.Ordinal))
                     {
                         break;
                     }
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
index a3ed037..0900c86 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
@@ -877,7 +877,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
                 {
                     string s = Regex.Replace(analyzedKey, "(^| )\u0000$", "");
                     s = Regex.Replace(s, "\\s+$", "");
-                    if (s.Equals(analyzedKey))
+                    if (s.Equals(analyzedKey, StringComparison.Ordinal))
                     {
                         break;
                     }
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Fst/FSTCompletionTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Fst/FSTCompletionTest.cs
index c85c079..035db0a 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/Fst/FSTCompletionTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/Fst/FSTCompletionTest.cs
@@ -220,8 +220,8 @@ namespace Lucene.Net.Search.Suggest.Fst
 
             IList<Lookup.LookupResult> result = lookup.DoLookup(StringToCharSequence("wit").ToString(), true, 5);
             assertEquals(5, result.size());
-            assertTrue(result[0].Key.toString().equals("wit"));  // exact match.
-            assertTrue(result[1].Key.toString().equals("with")); // highest count.
+            assertTrue(result[0].Key.toString().Equals("wit", StringComparison.Ordinal));  // exact match.
+            assertTrue(result[1].Key.toString().Equals("with", StringComparison.Ordinal)); // highest count.
         }
 
         [Test]
diff --git a/src/Lucene.Net.Tests/Analysis/TestGraphTokenizers.cs b/src/Lucene.Net.Tests/Analysis/TestGraphTokenizers.cs
index de3a32e..e18a208 100644
--- a/src/Lucene.Net.Tests/Analysis/TestGraphTokenizers.cs
+++ b/src/Lucene.Net.Tests/Analysis/TestGraphTokenizers.cs
@@ -286,7 +286,7 @@ namespace Lucene.Net.Analysis
                     {
                         return false;
                     }
-                    else if (TermAtt.ToString().Equals("a"))
+                    else if (TermAtt.ToString().Equals("a", StringComparison.Ordinal))
                     {
                         PendingPosInc += PosIncAtt.PositionIncrement;
                     }
diff --git a/src/Lucene.Net.Tests/Analysis/TrivialLookaheadFilter.cs b/src/Lucene.Net.Tests/Analysis/TrivialLookaheadFilter.cs
index b422026..523c308 100644
--- a/src/Lucene.Net.Tests/Analysis/TrivialLookaheadFilter.cs
+++ b/src/Lucene.Net.Tests/Analysis/TrivialLookaheadFilter.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.TokenAttributes;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Analysis
@@ -87,7 +88,7 @@ namespace Lucene.Net.Analysis
                 {
                     string term = new string(TermAtt.Buffer, 0, TermAtt.Length);
                     facts.Add(term + "-huh?");
-                    if (".".Equals(term))
+                    if (".".Equals(term, StringComparison.Ordinal))
                     {
                         haveSentence = true;
                     }
diff --git a/src/Lucene.Net.Tests/Codecs/Lucene3x/TestSurrogates.cs b/src/Lucene.Net.Tests/Codecs/Lucene3x/TestSurrogates.cs
index f056674..731ef64 100644
--- a/src/Lucene.Net.Tests/Codecs/Lucene3x/TestSurrogates.cs
+++ b/src/Lucene.Net.Tests/Codecs/Lucene3x/TestSurrogates.cs
@@ -109,7 +109,7 @@ namespace Lucene.Net.Codecs.Lucene3x
 
             public int Compare(Term term1, Term term2)
             {
-                if (term1.Field.Equals(term2.Field))
+                if (term1.Field.Equals(term2.Field, StringComparison.Ordinal))
                 {
                     return LegacyComparer.Compare(term1.Bytes, term2.Bytes);
                 }
@@ -225,7 +225,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                         break;
                     }
                     term = fieldTerms[1 + spot + i];
-                    if (!term.Field.Equals(field))
+                    if (!term.Field.Equals(field, StringComparison.Ordinal))
                     {
                         Assert.IsNull(te.Next());
                         break;
@@ -287,7 +287,7 @@ namespace Lucene.Net.Codecs.Lucene3x
 
                         spot = -spot - 1;
 
-                        if (spot == fieldTerms.Count || !fieldTerms[spot].Field.Equals(field))
+                        if (spot == fieldTerms.Count || !fieldTerms[spot].Field.Equals(field, StringComparison.Ordinal))
                         {
                             Assert.AreEqual(TermsEnum.SeekStatus.END, te.SeekCeil(tx.Bytes));
                         }
@@ -316,7 +316,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                                     break;
                                 }
                                 Term term = fieldTerms[1 + spot + i];
-                                if (!term.Field.Equals(field))
+                                if (!term.Field.Equals(field, StringComparison.Ordinal))
                                 {
                                     Assert.IsNull(te.Next());
                                     break;
diff --git a/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldDocValuesFormat.cs b/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldDocValuesFormat.cs
index 573becd..7b2fa70 100644
--- a/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldDocValuesFormat.cs
+++ b/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldDocValuesFormat.cs
@@ -144,7 +144,7 @@ namespace Lucene.Net.Codecs.PerField
 
             public override DocValuesFormat GetDocValuesFormatForField(string field)
             {
-                if ("dv1".Equals(field))
+                if ("dv1".Equals(field, StringComparison.Ordinal))
                 {
                     return Fast;
                 }
diff --git a/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldPostingsFormat2.cs b/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldPostingsFormat2.cs
index 8360578..5201c7b 100644
--- a/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldPostingsFormat2.cs
+++ b/src/Lucene.Net.Tests/Codecs/PerField/TestPerFieldPostingsFormat2.cs
@@ -207,11 +207,11 @@ namespace Lucene.Net.Codecs.PerField
 
             public override PostingsFormat GetPostingsFormatForField(string field)
             {
-                if (field.Equals("id"))
+                if (field.Equals("id", StringComparison.Ordinal))
                 {
                     return SimpleText;
                 }
-                else if (field.Equals("content"))
+                else if (field.Equals("content", StringComparison.Ordinal))
                 {
                     return MockSep;
                 }
@@ -229,7 +229,7 @@ namespace Lucene.Net.Codecs.PerField
 
             public override PostingsFormat GetPostingsFormatForField(string field)
             {
-                if (field.Equals("id"))
+                if (field.Equals("id", StringComparison.Ordinal))
                 {
                     return SimpleText;
                 }
@@ -297,11 +297,11 @@ namespace Lucene.Net.Codecs.PerField
 
             public override PostingsFormat GetPostingsFormatForField(string field)
             {
-                if ("id".Equals(field))
+                if ("id".Equals(field, StringComparison.Ordinal))
                 {
                     return new Pulsing41PostingsFormat(1);
                 }
-                else if ("date".Equals(field))
+                else if ("date".Equals(field, StringComparison.Ordinal))
                 {
                     return new Pulsing41PostingsFormat(1);
                 }
@@ -330,11 +330,11 @@ namespace Lucene.Net.Codecs.PerField
 
             public override PostingsFormat GetPostingsFormatForField(string field)
             {
-                if ("id".Equals(field))
+                if ("id".Equals(field, StringComparison.Ordinal))
                 {
                     return new Pulsing41PostingsFormat(1);
                 }
-                else if ("date".Equals(field))
+                else if ("date".Equals(field, StringComparison.Ordinal))
                 {
                     return new Pulsing41PostingsFormat(2);
                 }
diff --git a/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs b/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs
index 0fd7d90..264386f 100644
--- a/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs
+++ b/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs
@@ -76,12 +76,12 @@ namespace Lucene.Net.Documents
 
             string binaryFldStoredTest = Encoding.UTF8.GetString(bytes.Bytes).Substring(bytes.Offset, bytes.Length);
             //new string(bytes.Bytes, bytes.Offset, bytes.Length, IOUtils.CHARSET_UTF_8);
-            Assert.IsTrue(binaryFldStoredTest.Equals(BinaryValStored));
+            Assert.IsTrue(binaryFldStoredTest.Equals(BinaryValStored, StringComparison.Ordinal));
 
             /// <summary>
             /// fetch the string field and compare it's content with the original one </summary>
             string stringFldStoredTest = docFromReader.Get("stringStored");
-            Assert.IsTrue(stringFldStoredTest.Equals(BinaryValStored));
+            Assert.IsTrue(stringFldStoredTest.Equals(BinaryValStored, StringComparison.Ordinal));
 
             writer.Dispose();
             reader.Dispose();
@@ -110,10 +110,10 @@ namespace Lucene.Net.Documents
                         Encoding.UTF8.GetString(
                             CompressionTools.Decompress(docFromReader.GetBinaryValue("binaryCompressed")));
                     //new string(CompressionTools.Decompress(docFromReader.GetBinaryValue("binaryCompressed")), IOUtils.CHARSET_UTF_8);
-                    Assert.IsTrue(binaryFldCompressedTest.Equals(BinaryValCompressed));
+                    Assert.IsTrue(binaryFldCompressedTest.Equals(BinaryValCompressed, StringComparison.Ordinal));
                     Assert.IsTrue(
                         CompressionTools.DecompressString(docFromReader.GetBinaryValue("stringCompressed"))
-                            .Equals(BinaryValCompressed));
+                            .Equals(BinaryValCompressed, StringComparison.Ordinal));
                 }
 
             }
diff --git a/src/Lucene.Net.Tests/Document/TestDateTools.cs b/src/Lucene.Net.Tests/Document/TestDateTools.cs
index 8a4d823..664c936 100644
--- a/src/Lucene.Net.Tests/Document/TestDateTools.cs
+++ b/src/Lucene.Net.Tests/Document/TestDateTools.cs
@@ -211,7 +211,7 @@ namespace Lucene.Net.Documents
                 TimeZone.Default = TimeZone.getTimeZone("Europe/London"); // "GMT"
                 string d1 = DateTools.DateToString(new DateTime(time * 1000), DateTools.Resolution.MINUTE);
                 string d2 = DateTools.DateToString(new DateTime((time+3600) * 1000), DateTools.Resolution.MINUTE);
-                Assert.IsFalse(d1.Equals(d2), "different times");
+                Assert.IsFalse(d1.Equals(d2, StringComparison.Ordinal), "different times");
                 Assert.AreEqual(DateTools.StringToTime(d1), time * 1000, "midnight");
                 Assert.AreEqual(DateTools.StringToTime(d2), (time+3600) * 1000, "later");
             }
@@ -231,7 +231,7 @@ namespace Lucene.Net.Documents
                 System.String d1 = DateTools.DateToString(tempAux, DateTools.Resolution.MINUTE);
                 System.DateTime tempAux2 = time2;
                 System.String d2 = DateTools.DateToString(tempAux2, DateTools.Resolution.MINUTE);
-                Assert.IsFalse(d1.Equals(d2), "different times");
+                Assert.IsFalse(d1.Equals(d2, StringComparison.Ordinal), "different times");
                 Assert.AreEqual(DateTools.StringToTime(d1), time1.Ticks, "midnight");
                 Assert.AreEqual(DateTools.StringToTime(d2), time2.Ticks, "later");
             }
diff --git a/src/Lucene.Net.Tests/Document/TestDocument.cs b/src/Lucene.Net.Tests/Document/TestDocument.cs
index 040690d..54f1b1d 100644
--- a/src/Lucene.Net.Tests/Document/TestDocument.cs
+++ b/src/Lucene.Net.Tests/Document/TestDocument.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Support;
 using NUnit.Framework;
+using System;
 using System.IO;
 using System.Text;
 
@@ -71,10 +72,10 @@ namespace Lucene.Net.Documents
             Assert.IsFalse(binaryFld.IndexableFieldType.IsIndexed);
 
             string binaryTest = doc.GetBinaryValue("binary").Utf8ToString();
-            Assert.IsTrue(binaryTest.Equals(BinaryVal));
+            Assert.IsTrue(binaryTest.Equals(BinaryVal, StringComparison.Ordinal));
 
             string stringTest = doc.Get("string");
-            Assert.IsTrue(binaryTest.Equals(stringTest));
+            Assert.IsTrue(binaryTest.Equals(stringTest, StringComparison.Ordinal));
 
             doc.Add(binaryFld2);
 
@@ -87,10 +88,10 @@ namespace Lucene.Net.Documents
             binaryTest = binaryTests[0].Utf8ToString();
             string binaryTest2 = binaryTests[1].Utf8ToString();
 
-            Assert.IsFalse(binaryTest.Equals(binaryTest2));
+            Assert.IsFalse(binaryTest.Equals(binaryTest2, StringComparison.Ordinal));
 
-            Assert.IsTrue(binaryTest.Equals(BinaryVal));
-            Assert.IsTrue(binaryTest2.Equals(BinaryVal2));
+            Assert.IsTrue(binaryTest.Equals(BinaryVal, StringComparison.Ordinal));
+            Assert.IsTrue(binaryTest2.Equals(BinaryVal2, StringComparison.Ordinal));
 
             doc.RemoveField("string");
             Assert.AreEqual(2, doc.Fields.Count);
@@ -281,18 +282,18 @@ namespace Lucene.Net.Documents
                 Assert.IsTrue(unstoredFieldValues.Length == 2);
             }
 
-            Assert.IsTrue(keywordFieldValues[0].GetStringValue().Equals("test1"));
-            Assert.IsTrue(keywordFieldValues[1].GetStringValue().Equals("test2"));
-            Assert.IsTrue(textFieldValues[0].GetStringValue().Equals("test1"));
-            Assert.IsTrue(textFieldValues[1].GetStringValue().Equals("test2"));
-            Assert.IsTrue(unindexedFieldValues[0].GetStringValue().Equals("test1"));
-            Assert.IsTrue(unindexedFieldValues[1].GetStringValue().Equals("test2"));
+            Assert.IsTrue(keywordFieldValues[0].GetStringValue().Equals("test1", StringComparison.Ordinal));
+            Assert.IsTrue(keywordFieldValues[1].GetStringValue().Equals("test2", StringComparison.Ordinal));
+            Assert.IsTrue(textFieldValues[0].GetStringValue().Equals("test1", StringComparison.Ordinal));
+            Assert.IsTrue(textFieldValues[1].GetStringValue().Equals("test2", StringComparison.Ordinal));
+            Assert.IsTrue(unindexedFieldValues[0].GetStringValue().Equals("test1", StringComparison.Ordinal));
+            Assert.IsTrue(unindexedFieldValues[1].GetStringValue().Equals("test2", StringComparison.Ordinal));
             // this test cannot work for documents retrieved from the index
             // since unstored fields will obviously not be returned
             if (!fromIndex)
             {
-                Assert.IsTrue(unstoredFieldValues[0].GetStringValue().Equals("test1"));
-                Assert.IsTrue(unstoredFieldValues[1].GetStringValue().Equals("test2"));
+                Assert.IsTrue(unstoredFieldValues[0].GetStringValue().Equals("test1", StringComparison.Ordinal));
+                Assert.IsTrue(unstoredFieldValues[1].GetStringValue().Equals("test2", StringComparison.Ordinal));
             }
         }
 
@@ -325,15 +326,15 @@ namespace Lucene.Net.Documents
             {
                 Documents.Document doc2 = searcher.Doc(hits[i].Doc);
                 Field f = (Field)doc2.GetField("id");
-                if (f.GetStringValue().Equals("id1"))
+                if (f.GetStringValue().Equals("id1", StringComparison.Ordinal))
                 {
                     result |= 1;
                 }
-                else if (f.GetStringValue().Equals("id2"))
+                else if (f.GetStringValue().Equals("id2", StringComparison.Ordinal))
                 {
                     result |= 2;
                 }
-                else if (f.GetStringValue().Equals("id3"))
+                else if (f.GetStringValue().Equals("id3", StringComparison.Ordinal))
                 {
                     result |= 4;
                 }
@@ -412,7 +413,7 @@ namespace Lucene.Net.Documents
                 TermsEnum tvsEnum = tvs.GetIterator(null);
                 Assert.AreEqual(new BytesRef("abc"), tvsEnum.Next());
                 DocsAndPositionsEnum dpEnum = tvsEnum.DocsAndPositions(null, null);
-                if (field.Equals("tv"))
+                if (field.Equals("tv", StringComparison.Ordinal))
                 {
                     Assert.IsNull(dpEnum);
                 }
diff --git a/src/Lucene.Net.Tests/Index/Test2BTerms.cs b/src/Lucene.Net.Tests/Index/Test2BTerms.cs
index 540f89f..1dd7672 100644
--- a/src/Lucene.Net.Tests/Index/Test2BTerms.cs
+++ b/src/Lucene.Net.Tests/Index/Test2BTerms.cs
@@ -172,7 +172,7 @@ namespace Lucene.Net.Index
         [Test]
         public virtual void Test2BTerms_Mem([ValueSource(typeof(ConcurrentMergeSchedulerFactories), "Values")]Func<IConcurrentMergeScheduler> newScheduler)
         {
-            if ("Lucene3x".Equals(Codec.Default.Name))
+            if ("Lucene3x".Equals(Codec.Default.Name, StringComparison.Ordinal))
             {
                 throw new Exception("this test cannot run with PreFlex codec");
             }
diff --git a/src/Lucene.Net.Tests/Index/TestAddIndexes.cs b/src/Lucene.Net.Tests/Index/TestAddIndexes.cs
index b55556c..2b976bf 100644
--- a/src/Lucene.Net.Tests/Index/TestAddIndexes.cs
+++ b/src/Lucene.Net.Tests/Index/TestAddIndexes.cs
@@ -1147,11 +1147,11 @@ namespace Lucene.Net.Index
 
             public override PostingsFormat GetPostingsFormatForField(string field)
             {
-                if (field.Equals("id"))
+                if (field.Equals("id", StringComparison.Ordinal))
                 {
                     return SimpleTextFormat;
                 }
-                else if (field.Equals("content"))
+                else if (field.Equals("content", StringComparison.Ordinal))
                 {
                     return MockSepFormat;
                 }
@@ -1306,7 +1306,7 @@ namespace Lucene.Net.Index
             for (int docID = 0; docID < 2; docID++)
             {
                 Document d = r3.Document(docID);
-                if (d.Get("id").Equals("1"))
+                if (d.Get("id").Equals("1", StringComparison.Ordinal))
                 {
                     Assert.AreEqual("doc1 field1", d.Get("f1"));
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestAllFilesHaveChecksumFooter.cs b/src/Lucene.Net.Tests/Index/TestAllFilesHaveChecksumFooter.cs
index 2779dd5..948e2e1 100644
--- a/src/Lucene.Net.Tests/Index/TestAllFilesHaveChecksumFooter.cs
+++ b/src/Lucene.Net.Tests/Index/TestAllFilesHaveChecksumFooter.cs
@@ -80,7 +80,7 @@ namespace Lucene.Net.Index
         {
             foreach (string file in dir.ListAll())
             {
-                if (file.Equals(IndexWriter.WRITE_LOCK_NAME))
+                if (file.Equals(IndexWriter.WRITE_LOCK_NAME, StringComparison.Ordinal))
                 {
                     continue; // write.lock has no footer, thats ok
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestAllFilesHaveCodecHeader.cs b/src/Lucene.Net.Tests/Index/TestAllFilesHaveCodecHeader.cs
index 0b6d28c..282f586 100644
--- a/src/Lucene.Net.Tests/Index/TestAllFilesHaveCodecHeader.cs
+++ b/src/Lucene.Net.Tests/Index/TestAllFilesHaveCodecHeader.cs
@@ -80,11 +80,11 @@ namespace Lucene.Net.Index
         {
             foreach (string file in dir.ListAll())
             {
-                if (file.Equals(IndexWriter.WRITE_LOCK_NAME))
+                if (file.Equals(IndexWriter.WRITE_LOCK_NAME, StringComparison.Ordinal))
                 {
                     continue; // write.lock has no header, thats ok
                 }
-                if (file.Equals(IndexFileNames.SEGMENTS_GEN))
+                if (file.Equals(IndexFileNames.SEGMENTS_GEN, StringComparison.Ordinal))
                 {
                     continue; // segments.gen has no header, thats ok
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestBagOfPositions.cs b/src/Lucene.Net.Tests/Index/TestBagOfPositions.cs
index b8ef0c0..53c8b03 100644
--- a/src/Lucene.Net.Tests/Index/TestBagOfPositions.cs
+++ b/src/Lucene.Net.Tests/Index/TestBagOfPositions.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Index
             IList<string> postingsList = new List<string>();
             int numTerms = AtLeast(300);
             int maxTermsPerDoc = TestUtil.NextInt(Random(), 10, 20);
-            bool isSimpleText = "SimpleText".Equals(TestUtil.GetPostingsFormat("field"));
+            bool isSimpleText = "SimpleText".Equals(TestUtil.GetPostingsFormat("field"), StringComparison.Ordinal);
 
             IndexWriterConfig iwc = NewIndexWriterConfig(Random(), TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
 
diff --git a/src/Lucene.Net.Tests/Index/TestBagOfPostings.cs b/src/Lucene.Net.Tests/Index/TestBagOfPostings.cs
index 6bee4a6..21e8e3e 100644
--- a/src/Lucene.Net.Tests/Index/TestBagOfPostings.cs
+++ b/src/Lucene.Net.Tests/Index/TestBagOfPostings.cs
@@ -53,7 +53,7 @@ namespace Lucene.Net.Index
             int numTerms = AtLeast(300);
             int maxTermsPerDoc = TestUtil.NextInt(Random(), 10, 20);
 
-            bool isSimpleText = "SimpleText".Equals(TestUtil.GetPostingsFormat("field"));
+            bool isSimpleText = "SimpleText".Equals(TestUtil.GetPostingsFormat("field"), StringComparison.Ordinal);
 
             IndexWriterConfig iwc = NewIndexWriterConfig(Random(), TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
 
diff --git a/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs b/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs
index 5920f38..7d0c958 100644
--- a/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs
+++ b/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs
@@ -410,7 +410,7 @@ namespace Lucene.Net.Index
             IndexWriterConfig iwc = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
             iwc.SetMaxBufferedDocs(5);
             iwc.SetMergeScheduler(new TrackingCMS());
-            if (TestUtil.GetPostingsFormat("id").Equals("SimpleText"))
+            if (TestUtil.GetPostingsFormat("id").Equals("SimpleText", StringComparison.Ordinal))
             {
                 // no
                 iwc.SetCodec(TestUtil.AlwaysPostingsFormat(new Lucene41PostingsFormat()));
diff --git a/src/Lucene.Net.Tests/Index/TestCrashCausesCorruptIndex.cs b/src/Lucene.Net.Tests/Index/TestCrashCausesCorruptIndex.cs
index f3945ee..a12ff40 100644
--- a/src/Lucene.Net.Tests/Index/TestCrashCausesCorruptIndex.cs
+++ b/src/Lucene.Net.Tests/Index/TestCrashCausesCorruptIndex.cs
@@ -184,7 +184,7 @@ namespace Lucene.Net.Index
             public override IndexOutput CreateOutput(string name, IOContext cxt)
             {
                 IndexOutput indexOutput = m_input.CreateOutput(name, cxt);
-                if (null != CrashAfterCreateOutput_Renamed && name.Equals(CrashAfterCreateOutput_Renamed))
+                if (null != CrashAfterCreateOutput_Renamed && name.Equals(CrashAfterCreateOutput_Renamed, StringComparison.Ordinal))
                 {
                     // CRASH!
                     indexOutput.Dispose();
diff --git a/src/Lucene.Net.Tests/Index/TestDocInverterPerFieldErrorInfo.cs b/src/Lucene.Net.Tests/Index/TestDocInverterPerFieldErrorInfo.cs
index a01074d..d015652 100644
--- a/src/Lucene.Net.Tests/Index/TestDocInverterPerFieldErrorInfo.cs
+++ b/src/Lucene.Net.Tests/Index/TestDocInverterPerFieldErrorInfo.cs
@@ -57,7 +57,7 @@ namespace Lucene.Net.Index
             protected internal override TokenStreamComponents CreateComponents(string fieldName, TextReader input)
             {
                 Tokenizer tokenizer = new MockTokenizer(input);
-                if (fieldName.Equals("distinctiveFieldName"))
+                if (fieldName.Equals("distinctiveFieldName", StringComparison.Ordinal))
                 {
                     TokenFilter tosser = new TokenFilterAnonymousInnerClassHelper(this, tokenizer);
                     return new TokenStreamComponents(tokenizer, tosser);
diff --git a/src/Lucene.Net.Tests/Index/TestDocumentWriter.cs b/src/Lucene.Net.Tests/Index/TestDocumentWriter.cs
index 81a27c6..9409b46 100644
--- a/src/Lucene.Net.Tests/Index/TestDocumentWriter.cs
+++ b/src/Lucene.Net.Tests/Index/TestDocumentWriter.cs
@@ -22,6 +22,7 @@ namespace Lucene.Net.Index
 
     using Lucene.Net.Analysis;
     using NUnit.Framework;
+    using System;
     using System.IO;
     using AttributeSource = Lucene.Net.Util.AttributeSource;
     using BytesRef = Lucene.Net.Util.BytesRef;
@@ -79,25 +80,25 @@ namespace Lucene.Net.Index
             //System.out.println("Document: " + doc);
             IIndexableField[] fields = doc.GetFields("textField2");
             Assert.IsTrue(fields != null && fields.Length == 1);
-            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.FIELD_2_TEXT));
+            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.FIELD_2_TEXT, StringComparison.Ordinal));
             Assert.IsTrue(fields[0].IndexableFieldType.StoreTermVectors);
 
             fields = doc.GetFields("textField1");
             Assert.IsTrue(fields != null && fields.Length == 1);
-            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.FIELD_1_TEXT));
+            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.FIELD_1_TEXT, StringComparison.Ordinal));
             Assert.IsFalse(fields[0].IndexableFieldType.StoreTermVectors);
 
             fields = doc.GetFields("keyField");
             Assert.IsTrue(fields != null && fields.Length == 1);
-            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.KEYWORD_TEXT));
+            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.KEYWORD_TEXT, StringComparison.Ordinal));
 
             fields = doc.GetFields(DocHelper.NO_NORMS_KEY);
             Assert.IsTrue(fields != null && fields.Length == 1);
-            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.NO_NORMS_TEXT));
+            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.NO_NORMS_TEXT, StringComparison.Ordinal));
 
             fields = doc.GetFields(DocHelper.TEXT_FIELD_3_KEY);
             Assert.IsTrue(fields != null && fields.Length == 1);
-            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.FIELD_3_TEXT));
+            Assert.IsTrue(fields[0].GetStringValue().Equals(DocHelper.FIELD_3_TEXT, StringComparison.Ordinal));
 
             // test that the norms are not present in the segment if
             // omitNorms is true
diff --git a/src/Lucene.Net.Tests/Index/TestFilterAtomicReader.cs b/src/Lucene.Net.Tests/Index/TestFilterAtomicReader.cs
index 3cb8531..bb051e1 100644
--- a/src/Lucene.Net.Tests/Index/TestFilterAtomicReader.cs
+++ b/src/Lucene.Net.Tests/Index/TestFilterAtomicReader.cs
@@ -193,7 +193,7 @@ namespace Lucene.Net.Index
             {
                 // LUCENENET specific - since we changed to using a property for Attributes rather than a method,
                 // we need to reflect that as get_Attributes here.
-                if (m.IsStatic || m.IsAbstract || m.IsFinal || /*m.Synthetic ||*/ m.Name.Equals("get_Attributes"))
+                if (m.IsStatic || m.IsAbstract || m.IsFinal || /*m.Synthetic ||*/ m.Name.Equals("get_Attributes", StringComparison.Ordinal))
                 {
                     continue;
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestIndexFileDeleter.cs b/src/Lucene.Net.Tests/Index/TestIndexFileDeleter.cs
index 7b83e68..25428e9 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexFileDeleter.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexFileDeleter.cs
@@ -89,7 +89,7 @@ namespace Lucene.Net.Index
             */
 
             // TODO: fix this test better
-            string ext = Codec.Default.Name.Equals("SimpleText") ? ".liv" : ".del";
+            string ext = Codec.Default.Name.Equals("SimpleText", StringComparison.Ordinal) ? ".liv" : ".del";
 
             // Create a bogus separate del file for a
             // segment that already has a separate del file:
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriter.cs b/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
index 077bf05..b99a7cf 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
@@ -2825,11 +2825,11 @@ namespace Lucene.Net.Index
 
             public void Apply(string message)
             {
-                if ("startCommitMerge".Equals(message))
+                if ("startCommitMerge".Equals(message, StringComparison.Ordinal))
                 {
                     IwRef.Get().KeepFullyDeletedSegments = false;
                 }
-                else if ("startMergeInit".Equals(message))
+                else if ("startMergeInit".Equals(message, StringComparison.Ordinal))
                 {
                     IwRef.Get().KeepFullyDeletedSegments = true;
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterCommit.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterCommit.cs
index 103c0b3..0a5f2ae 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterCommit.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterCommit.cs
@@ -202,7 +202,7 @@ namespace Lucene.Net.Index
 
             string idFormat = TestUtil.GetPostingsFormat("id");
             string contentFormat = TestUtil.GetPostingsFormat("content");
-            AssumeFalse("this test cannot run with Memory codec", idFormat.Equals("Memory") || contentFormat.Equals("Memory"));
+            AssumeFalse("this test cannot run with Memory codec", idFormat.Equals("Memory", StringComparison.Ordinal) || contentFormat.Equals("Memory", StringComparison.Ordinal));
             MockDirectoryWrapper dir = NewMockDirectory();
             Analyzer analyzer;
             if (Random().NextBoolean())
@@ -514,7 +514,7 @@ namespace Lucene.Net.Index
             IndexCommit commit = null;
             foreach (IndexCommit c in DirectoryReader.ListCommits(dir))
             {
-                if (c.UserData["tag"].Equals("first"))
+                if (c.UserData["tag"].Equals("first", StringComparison.Ordinal))
                 {
                     commit = c;
                     break;
@@ -537,7 +537,7 @@ namespace Lucene.Net.Index
             commit = null;
             foreach (IndexCommit c in DirectoryReader.ListCommits(dir))
             {
-                if (c.UserData["tag"].Equals("second"))
+                if (c.UserData["tag"].Equals("second", StringComparison.Ordinal))
                 {
                     commit = c;
                     break;
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterConfig.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterConfig.cs
index c7ddaed..622027c 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterConfig.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterConfig.cs
@@ -254,13 +254,13 @@ namespace Lucene.Net.Index
                     // Skip static final fields, they are only constants
                     continue;
                 }
-                else if ("indexingChain".Equals(f.Name))
+                else if ("indexingChain".Equals(f.Name, StringComparison.Ordinal))
                 {
                     // indexingChain is a package-private setting and thus is not output by
                     // toString.
                     continue;
                 }
-                if (f.Name.Equals("inUseByIndexWriter"))
+                if (f.Name.Equals("inUseByIndexWriter", StringComparison.Ordinal))
                 {
                     continue;
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs
index 2a93606..2ba58cf 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs
@@ -1145,9 +1145,9 @@ namespace Lucene.Net.Index
             // TODO: move this test to its own class and just @SuppressCodecs?
             // TODO: is it enough to just use newFSDirectory?
             string fieldFormat = TestUtil.GetPostingsFormat("field");
-            AssumeFalse("this test cannot run with Memory codec", fieldFormat.Equals("Memory"));
-            AssumeFalse("this test cannot run with SimpleText codec", fieldFormat.Equals("SimpleText"));
-            AssumeFalse("this test cannot run with Direct codec", fieldFormat.Equals("Direct"));
+            AssumeFalse("this test cannot run with Memory codec", fieldFormat.Equals("Memory", StringComparison.Ordinal));
+            AssumeFalse("this test cannot run with SimpleText codec", fieldFormat.Equals("SimpleText", StringComparison.Ordinal));
+            AssumeFalse("this test cannot run with Direct codec", fieldFormat.Equals("Direct", StringComparison.Ordinal));
             Random r = Random();
             Directory dir = NewDirectory();
             // note this test explicitly disables payloads
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs
index 3823b57..d2373d5 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs
@@ -293,7 +293,7 @@ namespace Lucene.Net.Index
 
             public void Apply(string name)
             {
-                if (OuterInstance.DoFail.Value != null && !name.Equals("startDoFlush") && r.Next(40) == 17)
+                if (OuterInstance.DoFail.Value != null && !name.Equals("startDoFlush", StringComparison.Ordinal) && r.Next(40) == 17)
                 {
                     if (VERBOSE)
                     {
@@ -453,7 +453,7 @@ namespace Lucene.Net.Index
 
             public void Apply(string name)
             {
-                if (DoFail && name.Equals("DocumentsWriterPerThread addDocument start"))
+                if (DoFail && name.Equals("DocumentsWriterPerThread addDocument start", StringComparison.Ordinal))
                 {
                     throw new Exception("intentionally failing");
                 }
@@ -478,7 +478,7 @@ namespace Lucene.Net.Index
 
             public sealed override bool IncrementToken()
             {
-                if (this.FieldName.Equals("crash") && Count++ >= 4)
+                if (this.FieldName.Equals("crash", StringComparison.Ordinal) && Count++ >= 4)
                 {
                     throw new IOException(CRASH_FAIL_MESSAGE);
                 }
@@ -572,7 +572,7 @@ namespace Lucene.Net.Index
 
             public void Apply(string name)
             {
-                if (DoFail && name.Equals("startMergeInit"))
+                if (DoFail && name.Equals("startMergeInit", StringComparison.Ordinal))
                 {
                     Failed = true;
                     throw new Exception("intentionally failing");
@@ -1340,7 +1340,7 @@ namespace Lucene.Net.Index
 
             public void Apply(string name)
             {
-                if (DoFail && name.Equals("rollback before checkpoint"))
+                if (DoFail && name.Equals("rollback before checkpoint", StringComparison.Ordinal))
                 {
                     throw new Exception("intentionally failing");
                 }
@@ -2583,7 +2583,7 @@ namespace Lucene.Net.Index
 
             public override void Message(string component, string message)
             {
-                if (MessageToFailOn.Equals(message))
+                if (MessageToFailOn.Equals(message, StringComparison.Ordinal))
                 {
                     throw new Exception("BOOM!");
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs
index e373fea..d690690 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs
@@ -91,7 +91,7 @@ namespace Lucene.Net.Index
                 Document temp = reader.Document(i);
                 //System.out.println("doc "+i+"="+temp.GetField("count").StringValue);
                 //compare the index doc number to the value that it should be
-                if (!temp.GetField("count").GetStringValue().Equals((i + startAt) + ""))
+                if (!temp.GetField("count").GetStringValue().Equals((i + startAt) + "", StringComparison.Ordinal))
                 {
                     fail = true;
                     Console.WriteLine("Document " + (i + startAt) + " is returning document " + temp.GetField("count").GetStringValue());
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs
index 4625a1c..20d4cd9 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs
@@ -192,7 +192,7 @@ namespace Lucene.Net.Index
 
             string idFormat = TestUtil.GetPostingsFormat("id");
             string contentFormat = TestUtil.GetPostingsFormat("content");
-            AssumeFalse("this test cannot run with Memory codec", idFormat.Equals("Memory") || contentFormat.Equals("Memory"));
+            AssumeFalse("this test cannot run with Memory codec", idFormat.Equals("Memory", StringComparison.Ordinal) || contentFormat.Equals("Memory", StringComparison.Ordinal));
 
             int START_COUNT = 57;
             int NUM_DIR = TEST_NIGHTLY ? 50 : 5;
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterOnJRECrash.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterOnJRECrash.cs
index 968b24e..0212d3c 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterOnJRECrash.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterOnJRECrash.cs
@@ -76,7 +76,7 @@
 //            else
 //            {
 //                // TODO: the non-fork code could simply enable impersonation?
-//                AssumeFalse("does not support PreFlex, see LUCENE-3992", Codec.Default.Name.Equals("Lucene3x"));
+//                AssumeFalse("does not support PreFlex, see LUCENE-3992", Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal));
 //                // we are the fork, setup a crashing thread
 //                int crashTime = TestUtil.NextInt(Random(), 3000, 4000);
 //                ThreadClass t = new ThreadAnonymousInnerClassHelper(this, crashTime);
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
index 5d1177b..9fd3402 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
@@ -1244,7 +1244,7 @@ namespace Lucene.Net.Index
 
             public override void Message(string component, string message)
             {
-                if ("SMSW".Equals(component))
+                if ("SMSW".Equals(component, StringComparison.Ordinal))
                 {
                     DidWarm.Set(true);
                 }
@@ -1261,13 +1261,21 @@ namespace Lucene.Net.Index
         {
             // Some Codecs don't honor the ReaderTermsIndexDivisor, so skip the test if
             // they're picked.
-            AssumeFalse("PreFlex codec does not support ReaderTermsIndexDivisor!", "Lucene3x".Equals(Codec.Default.Name));
+            AssumeFalse("PreFlex codec does not support ReaderTermsIndexDivisor!", "Lucene3x".Equals(Codec.Default.Name, StringComparison.Ordinal));
 
             IndexWriterConfig conf = (IndexWriterConfig)NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetReaderTermsIndexDivisor(-1);
 
             // Don't proceed if picked Codec is in the list of illegal ones.
             string format = TestUtil.GetPostingsFormat("f");
-            AssumeFalse("Format: " + format + " does not support ReaderTermsIndexDivisor!", (format.Equals("FSTPulsing41") || format.Equals("FSTOrdPulsing41") || format.Equals("FST41") || format.Equals("FSTOrd41") || format.Equals("SimpleText") || format.Equals("Memory") || format.Equals("MockRandom") || format.Equals("Direct")));
+            AssumeFalse("Format: " + format + " does not support ReaderTermsIndexDivisor!", 
+                (format.Equals("FSTPulsing41", StringComparison.Ordinal) || 
+                format.Equals("FSTOrdPulsing41", StringComparison.Ordinal) || 
+                format.Equals("FST41", StringComparison.Ordinal) || 
+                format.Equals("FSTOrd41", StringComparison.Ordinal) || 
+                format.Equals("SimpleText", StringComparison.Ordinal) || 
+                format.Equals("Memory", StringComparison.Ordinal) || 
+                format.Equals("MockRandom", StringComparison.Ordinal) || 
+                format.Equals("Direct", StringComparison.Ordinal)));
 
             Directory dir = NewDirectory();
             IndexWriter w = new IndexWriter(dir, conf);
diff --git a/src/Lucene.Net.Tests/Index/TestLazyProxSkipping.cs b/src/Lucene.Net.Tests/Index/TestLazyProxSkipping.cs
index 2553cf1..6100ea3 100644
--- a/src/Lucene.Net.Tests/Index/TestLazyProxSkipping.cs
+++ b/src/Lucene.Net.Tests/Index/TestLazyProxSkipping.cs
@@ -157,9 +157,9 @@ namespace Lucene.Net.Index
         public virtual void TestLazySkipping()
         {
             string fieldFormat = TestUtil.GetPostingsFormat(this.Field);
-            AssumeFalse("this test cannot run with Memory postings format", fieldFormat.Equals("Memory"));
-            AssumeFalse("this test cannot run with Direct postings format", fieldFormat.Equals("Direct"));
-            AssumeFalse("this test cannot run with SimpleText postings format", fieldFormat.Equals("SimpleText"));
+            AssumeFalse("this test cannot run with Memory postings format", fieldFormat.Equals("Memory", StringComparison.Ordinal));
+            AssumeFalse("this test cannot run with Direct postings format", fieldFormat.Equals("Direct", StringComparison.Ordinal));
+            AssumeFalse("this test cannot run with SimpleText postings format", fieldFormat.Equals("SimpleText", StringComparison.Ordinal));
 
             // test whether only the minimum amount of seeks()
             // are performed
diff --git a/src/Lucene.Net.Tests/Index/TestLongPostings.cs b/src/Lucene.Net.Tests/Index/TestLongPostings.cs
index e7247c5..b180d72 100644
--- a/src/Lucene.Net.Tests/Index/TestLongPostings.cs
+++ b/src/Lucene.Net.Tests/Index/TestLongPostings.cs
@@ -3,6 +3,7 @@ using Lucene.Net.Documents;
 using Lucene.Net.Randomized.Generators;
 using Lucene.Net.Support;
 using NUnit.Framework;
+using System;
 using System.Diagnostics;
 using System.IO;
 using Console = Lucene.Net.Support.SystemConsole;
@@ -53,7 +54,7 @@ namespace Lucene.Net.Index
             while (true)
             {
                 string s = TestUtil.RandomRealisticUnicodeString(Random());
-                if (other != null && s.Equals(other))
+                if (other != null && s.Equals(other, StringComparison.Ordinal))
                 {
                     continue;
                 }
@@ -71,7 +72,7 @@ namespace Lucene.Net.Index
                     while (ts.IncrementToken())
                     {
                         termAtt.FillBytesRef();
-                        if (count == 0 && !termBytes.Utf8ToString().Equals(s))
+                        if (count == 0 && !termBytes.Utf8ToString().Equals(s, StringComparison.Ordinal))
                         {
                             // The value was changed during analysis.  Keep iterating so the
                             // tokenStream is exhausted.
diff --git a/src/Lucene.Net.Tests/Index/TestNoMergePolicy.cs b/src/Lucene.Net.Tests/Index/TestNoMergePolicy.cs
index 98b9b4f..2c0a8c8 100644
--- a/src/Lucene.Net.Tests/Index/TestNoMergePolicy.cs
+++ b/src/Lucene.Net.Tests/Index/TestNoMergePolicy.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Support;
 using NUnit.Framework;
+using System;
 using System.Reflection;
 
 namespace Lucene.Net.Index
@@ -69,7 +70,7 @@ namespace Lucene.Net.Index
                 // context, including ones from Object. So just filter out Object. If in
                 // the future MergePolicy will extend a different class than Object, this
                 // will need to change.
-                if (m.Name.Equals("Clone"))
+                if (m.Name.Equals("Clone", StringComparison.Ordinal))
                 {
                     continue;
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestNorms.cs b/src/Lucene.Net.Tests/Index/TestNorms.cs
index c0469b6..738edbc 100644
--- a/src/Lucene.Net.Tests/Index/TestNorms.cs
+++ b/src/Lucene.Net.Tests/Index/TestNorms.cs
@@ -215,7 +215,7 @@ namespace Lucene.Net.Index
 
             public override Similarity Get(string field)
             {
-                if (OuterInstance.ByteTestField.Equals(field))
+                if (OuterInstance.ByteTestField.Equals(field, StringComparison.Ordinal))
                 {
                     return new ByteEncodingBoostSimilarity();
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestPerSegmentDeletes.cs b/src/Lucene.Net.Tests/Index/TestPerSegmentDeletes.cs
index 3c3e1a5..5190be5 100644
--- a/src/Lucene.Net.Tests/Index/TestPerSegmentDeletes.cs
+++ b/src/Lucene.Net.Tests/Index/TestPerSegmentDeletes.cs
@@ -223,7 +223,7 @@ namespace Lucene.Net.Index
         {
             foreach (SegmentCommitInfo si in infos.Segments)
             {
-                if (si.Info.Name.Equals(info.Info.Name))
+                if (si.Info.Name.Equals(info.Info.Name, StringComparison.Ordinal))
                 {
                     return true;
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs b/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs
index 09587f3..f77f3cc 100644
--- a/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs
+++ b/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs
@@ -138,7 +138,7 @@ namespace Lucene.Net.Index
             }
             catch (IOException ioe)
             {
-                if (ioe.Message.Equals("now fail on purpose"))
+                if (ioe.Message.Equals("now fail on purpose", StringComparison.Ordinal))
                 {
                     // ok
                 }
diff --git a/src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs b/src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs
index 4fc5676..f5ec413 100644
--- a/src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs
+++ b/src/Lucene.Net.Tests/Index/TestPostingsOffsets.cs
@@ -181,7 +181,7 @@ namespace Lucene.Net.Index
                         int end = dp.EndOffset;
                         Debug.Assert(end >= 0 && end >= start);
                         // check that the offsets correspond to the term in the src text
-                        Assert.IsTrue(storedNumbers.Substring(start, end - start).Equals(term));
+                        Assert.IsTrue(storedNumbers.Substring(start, end - start).Equals(term, StringComparison.Ordinal));
                         if (withPayloads)
                         {
                             // check that we have a payload and it starts with "pos"
@@ -212,7 +212,7 @@ namespace Lucene.Net.Index
                     int end = dp.EndOffset;
                     Debug.Assert(end >= 0 && end >= start);
                     // check that the offsets correspond to the term in the src text
-                    Assert.IsTrue(storedNumbers.Substring(start, end - start).Equals("hundred"));
+                    Assert.IsTrue(storedNumbers.Substring(start, end - start).Equals("hundred", StringComparison.Ordinal));
                     if (withPayloads)
                     {
                         // check that we have a payload and it starts with "pos"
diff --git a/src/Lucene.Net.Tests/Index/TestRollingUpdates.cs b/src/Lucene.Net.Tests/Index/TestRollingUpdates.cs
index 7f3a360..f7b5a03 100644
--- a/src/Lucene.Net.Tests/Index/TestRollingUpdates.cs
+++ b/src/Lucene.Net.Tests/Index/TestRollingUpdates.cs
@@ -50,7 +50,7 @@ namespace Lucene.Net.Index
             LineFileDocs docs = new LineFileDocs(random, DefaultCodecSupportsDocValues());
 
             //provider.register(new MemoryCodec());
-            if ((!"Lucene3x".Equals(Codec.Default.Name)) && Random().NextBoolean())
+            if ((!"Lucene3x".Equals(Codec.Default.Name, StringComparison.Ordinal)) && Random().NextBoolean())
             {
                 Codec.Default =
                     TestUtil.AlwaysPostingsFormat(new MemoryPostingsFormat(Random().nextBoolean(), random.NextFloat()));
diff --git a/src/Lucene.Net.Tests/Index/TestSegmentReader.cs b/src/Lucene.Net.Tests/Index/TestSegmentReader.cs
index 95da6b6..119e8bb 100644
--- a/src/Lucene.Net.Tests/Index/TestSegmentReader.cs
+++ b/src/Lucene.Net.Tests/Index/TestSegmentReader.cs
@@ -118,13 +118,13 @@ namespace Lucene.Net.Index
             Assert.IsTrue(allFieldNames.Count == DocHelper.All.Count);
             foreach (string s in allFieldNames)
             {
-                Assert.IsTrue(DocHelper.NameValues.ContainsKey(s) == true || s.Equals(""));
+                Assert.IsTrue(DocHelper.NameValues.ContainsKey(s) == true || s.Equals("", StringComparison.Ordinal));
             }
 
             Assert.IsTrue(indexedFieldNames.Count == DocHelper.Indexed.Count);
             foreach (string s in indexedFieldNames)
             {
-                Assert.IsTrue(DocHelper.Indexed.ContainsKey(s) == true || s.Equals(""));
+                Assert.IsTrue(DocHelper.Indexed.ContainsKey(s) == true || s.Equals("", StringComparison.Ordinal));
             }
 
             Assert.IsTrue(notIndexedFieldNames.Count == DocHelper.Unindexed.Count);
diff --git a/src/Lucene.Net.Tests/Index/TestTermsEnum2.cs b/src/Lucene.Net.Tests/Index/TestTermsEnum2.cs
index 4e9034c..30b112f 100644
--- a/src/Lucene.Net.Tests/Index/TestTermsEnum2.cs
+++ b/src/Lucene.Net.Tests/Index/TestTermsEnum2.cs
@@ -7,6 +7,7 @@ namespace Lucene.Net.Index
     using Lucene.Net.Support;
     using Lucene.Net.Util.Automaton;
     using NUnit.Framework;
+    using System;
     using AutomatonQuery = Lucene.Net.Search.AutomatonQuery;
     using BytesRef = Lucene.Net.Util.BytesRef;
     using CheckHits = Lucene.Net.Search.CheckHits;
@@ -55,7 +56,7 @@ namespace Lucene.Net.Index
             base.SetUp();
             // we generate aweful regexps: good for testing.
             // but for preflex codec, the test can be very slow, so use less iterations.
-            NumIterations = Codec.Default.Name.Equals("Lucene3x") ? 10 * RANDOM_MULTIPLIER : AtLeast(50);
+            NumIterations = Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal) ? 10 * RANDOM_MULTIPLIER : AtLeast(50);
             Dir = NewDirectory();
             RandomIndexWriter writer = new RandomIndexWriter(Random(), Dir, (IndexWriterConfig)NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random(), MockTokenizer.KEYWORD, false)).SetMaxBufferedDocs(TestUtil.NextInt(Random(), 50, 1000)));
             Document doc = new Document();
diff --git a/src/Lucene.Net.Tests/Search/Payloads/PayloadHelper.cs b/src/Lucene.Net.Tests/Search/Payloads/PayloadHelper.cs
index 406c402..a7eb7b2 100644
--- a/src/Lucene.Net.Tests/Search/Payloads/PayloadHelper.cs
+++ b/src/Lucene.Net.Tests/Search/Payloads/PayloadHelper.cs
@@ -91,11 +91,11 @@ namespace Lucene.Net.Search.Payloads
             {
                 if (m_input.IncrementToken())
                 {
-                    if (FieldName.Equals(FIELD))
+                    if (FieldName.Equals(FIELD, StringComparison.Ordinal))
                     {
                         PayloadAtt.Payload = new BytesRef(OuterInstance.PayloadField);
                     }
-                    else if (FieldName.Equals(MULTI_FIELD))
+                    else if (FieldName.Equals(MULTI_FIELD, StringComparison.Ordinal))
                     {
                         if (NumSeen % 2 == 0)
                         {
diff --git a/src/Lucene.Net.Tests/Search/Payloads/TestPayloadTermQuery.cs b/src/Lucene.Net.Tests/Search/Payloads/TestPayloadTermQuery.cs
index 4291df3..4809167 100644
--- a/src/Lucene.Net.Tests/Search/Payloads/TestPayloadTermQuery.cs
+++ b/src/Lucene.Net.Tests/Search/Payloads/TestPayloadTermQuery.cs
@@ -23,6 +23,7 @@ namespace Lucene.Net.Search.Payloads
 
     using Lucene.Net.Analysis;
     using NUnit.Framework;
+    using System;
     using System.IO;
     using BytesRef = Lucene.Net.Util.BytesRef;
     using DefaultSimilarity = Lucene.Net.Search.Similarities.DefaultSimilarity;
@@ -85,11 +86,11 @@ namespace Lucene.Net.Search.Payloads
                 bool hasNext = m_input.IncrementToken();
                 if (hasNext)
                 {
-                    if (FieldName.Equals("field"))
+                    if (FieldName.Equals("field", StringComparison.Ordinal))
                     {
                         PayloadAtt.Payload = new BytesRef(PayloadField);
                     }
-                    else if (FieldName.Equals("multiField"))
+                    else if (FieldName.Equals("multiField", StringComparison.Ordinal))
                     {
                         if (NumSeen % 2 == 0)
                         {
diff --git a/src/Lucene.Net.Tests/Search/Similarities/TestSimilarityBase.cs b/src/Lucene.Net.Tests/Search/Similarities/TestSimilarityBase.cs
index 1fd532c..b2d596b 100644
--- a/src/Lucene.Net.Tests/Search/Similarities/TestSimilarityBase.cs
+++ b/src/Lucene.Net.Tests/Search/Similarities/TestSimilarityBase.cs
@@ -610,7 +610,7 @@ namespace Lucene.Net.Search.Similarities
         [Test]
         public virtual void TestHeartRanking()
         {
-            AssumeFalse("PreFlex codec does not support the stats necessary for this test!", "Lucene3x".Equals(Codec.Default.Name));
+            AssumeFalse("PreFlex codec does not support the stats necessary for this test!", "Lucene3x".Equals(Codec.Default.Name, StringComparison.Ordinal));
 
             Query q = new TermQuery(new Term(FIELD_BODY, "heart"));
 
diff --git a/src/Lucene.Net.Tests/Search/TestDisjunctionMaxQuery.cs b/src/Lucene.Net.Tests/Search/TestDisjunctionMaxQuery.cs
index e43d2e8..77722c7 100644
--- a/src/Lucene.Net.Tests/Search/TestDisjunctionMaxQuery.cs
+++ b/src/Lucene.Net.Tests/Search/TestDisjunctionMaxQuery.cs
@@ -433,8 +433,8 @@ namespace Lucene.Net.Search
                 string doc2 = s.Doc(h[2].Doc).Get("id");
                 string doc3 = s.Doc(h[3].Doc).Get("id");
 
-                Assert.IsTrue(doc0.Equals("d2") || doc0.Equals("d4"), "doc0 should be d2 or d4: " + doc0);
-                Assert.IsTrue(doc1.Equals("d2") || doc1.Equals("d4"), "doc1 should be d2 or d4: " + doc0);
+                Assert.IsTrue(doc0.Equals("d2", StringComparison.Ordinal) || doc0.Equals("d4", StringComparison.Ordinal), "doc0 should be d2 or d4: " + doc0);
+                Assert.IsTrue(doc1.Equals("d2", StringComparison.Ordinal) || doc1.Equals("d4", StringComparison.Ordinal), "doc1 should be d2 or d4: " + doc0);
                 Assert.AreEqual(score0, score1, SCORE_COMP_THRESH, "score0 and score1 should match");
                 Assert.AreEqual("d3", doc2, "wrong third");
                 Assert.IsTrue(score1 > score2, "d3 does not have worse score then d2 and d4: " + score1 + " >? " + score2);
diff --git a/src/Lucene.Net.Tests/Search/TestDocValuesScoring.cs b/src/Lucene.Net.Tests/Search/TestDocValuesScoring.cs
index ebd3e72..99c031e 100644
--- a/src/Lucene.Net.Tests/Search/TestDocValuesScoring.cs
+++ b/src/Lucene.Net.Tests/Search/TestDocValuesScoring.cs
@@ -35,6 +35,7 @@ namespace Lucene.Net.Search
     using RandomIndexWriter = Lucene.Net.Index.RandomIndexWriter;
     using Similarity = Lucene.Net.Search.Similarities.Similarity;
     using Term = Lucene.Net.Index.Term;
+    using System;
 
     /// <summary>
     /// Tests the use of indexdocvalues in scoring.
@@ -140,7 +141,7 @@ namespace Lucene.Net.Search
 
             public override Similarity Get(string field)
             {
-                return "foo".Equals(field) ? fooSim : @base;
+                return "foo".Equals(field, StringComparison.Ordinal) ? fooSim : @base;
             }
 
             public override float Coord(int overlap, int maxOverlap)
diff --git a/src/Lucene.Net.Tests/Search/TestFieldCache.cs b/src/Lucene.Net.Tests/Search/TestFieldCache.cs
index e36c6a6..199fb41 100644
--- a/src/Lucene.Net.Tests/Search/TestFieldCache.cs
+++ b/src/Lucene.Net.Tests/Search/TestFieldCache.cs
@@ -292,7 +292,7 @@ namespace Lucene.Net.Search
                     term = br;
                 }
                 string s = term == null ? null : term.Utf8ToString();
-                Assert.IsTrue(UnicodeStrings[i] == null || UnicodeStrings[i].Equals(s), "for doc " + i + ": " + s + " does not equal: " + UnicodeStrings[i]);
+                Assert.IsTrue(UnicodeStrings[i] == null || UnicodeStrings[i].Equals(s, StringComparison.Ordinal), "for doc " + i + ": " + s + " does not equal: " + UnicodeStrings[i]);
             }
 
             int nTerms = termsIndex.ValueCount;
@@ -344,7 +344,7 @@ namespace Lucene.Net.Search
                     term = br;
                 }
                 string s = term == null ? null : term.Utf8ToString();
-                Assert.IsTrue(UnicodeStrings[i] == null || UnicodeStrings[i].Equals(s), "for doc " + i + ": " + s + " does not equal: " + UnicodeStrings[i]);
+                Assert.IsTrue(UnicodeStrings[i] == null || UnicodeStrings[i].Equals(s, StringComparison.Ordinal), "for doc " + i + ": " + s + " does not equal: " + UnicodeStrings[i]);
             }
 
             // test bad field
diff --git a/src/Lucene.Net.Tests/Search/TestMultiThreadTermVectors.cs b/src/Lucene.Net.Tests/Search/TestMultiThreadTermVectors.cs
index e07a5f6..c34f38c 100644
--- a/src/Lucene.Net.Tests/Search/TestMultiThreadTermVectors.cs
+++ b/src/Lucene.Net.Tests/Search/TestMultiThreadTermVectors.cs
@@ -237,7 +237,7 @@ namespace Lucene.Net.Search
             {
                 temp.Append(vector.Term.Utf8ToString());
             }
-            if (!English.IntToEnglish(num).Trim().Equals(temp.ToString().Trim()))
+            if (!English.IntToEnglish(num).Trim().Equals(temp.ToString().Trim(), StringComparison.Ordinal))
             {
                 Console.WriteLine("wrong term result");
             }
diff --git a/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs b/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs
index e96c125..56f370a 100644
--- a/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs
+++ b/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs
@@ -312,7 +312,7 @@ namespace Lucene.Net.Search
             {
                 string s = Encoding.UTF8.GetString(bytes);
                 //System.out.println(s);
-                sawZero |= s.Equals("pos: 0");
+                sawZero |= s.Equals("pos: 0", StringComparison.Ordinal);
             }
             Assert.AreEqual(5, count);
             Assert.IsTrue(sawZero);
diff --git a/src/Lucene.Net.Tests/Search/TestPrefixRandom.cs b/src/Lucene.Net.Tests/Search/TestPrefixRandom.cs
index eb579a6..8501078 100644
--- a/src/Lucene.Net.Tests/Search/TestPrefixRandom.cs
+++ b/src/Lucene.Net.Tests/Search/TestPrefixRandom.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Documents;
 using Lucene.Net.Support;
 using NUnit.Framework;
+using System;
 
 namespace Lucene.Net.Search
 {
@@ -65,7 +66,7 @@ namespace Lucene.Net.Search
             // we generate aweful prefixes: good for testing.
             // but for preflex codec, the test can be very slow, so use less iterations.
             string codec = Codec.Default.Name;
-            int num = codec.Equals("Lucene3x") ? 200 * RANDOM_MULTIPLIER : AtLeast(1000);
+            int num = codec.Equals("Lucene3x", StringComparison.Ordinal) ? 200 * RANDOM_MULTIPLIER : AtLeast(1000);
             for (int i = 0; i < num; i++)
             {
                 field.SetStringValue(TestUtil.RandomUnicodeString(Random(), 10));
diff --git a/src/Lucene.Net.Tests/Search/TestRegexpQuery.cs b/src/Lucene.Net.Tests/Search/TestRegexpQuery.cs
index fc8afbc..be262e0 100644
--- a/src/Lucene.Net.Tests/Search/TestRegexpQuery.cs
+++ b/src/Lucene.Net.Tests/Search/TestRegexpQuery.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Util.Automaton;
 using Lucene.Net.Documents;
 using Lucene.Net.Support;
 using NUnit.Framework;
+using System;
 
 namespace Lucene.Net.Search
 {
@@ -136,7 +137,7 @@ namespace Lucene.Net.Search
 
             public Automaton GetAutomaton(string name)
             {
-                if (name.Equals("quickBrown"))
+                if (name.Equals("quickBrown", StringComparison.Ordinal))
                 {
                     return quickBrownAutomaton;
                 }
diff --git a/src/Lucene.Net.Tests/Search/TestRegexpRandom2.cs b/src/Lucene.Net.Tests/Search/TestRegexpRandom2.cs
index 3ccbbb1..afb27d9 100644
--- a/src/Lucene.Net.Tests/Search/TestRegexpRandom2.cs
+++ b/src/Lucene.Net.Tests/Search/TestRegexpRandom2.cs
@@ -167,7 +167,7 @@ namespace Lucene.Net.Search
         {
             // we generate aweful regexps: good for testing.
             // but for preflex codec, the test can be very slow, so use less iterations.
-            int num = Codec.Default.Name.Equals("Lucene3x") ? 100 * RANDOM_MULTIPLIER : AtLeast(1000);
+            int num = Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal) ? 100 * RANDOM_MULTIPLIER : AtLeast(1000);
             for (int i = 0; i < num; i++)
             {
                 string reg = AutomatonTestUtil.RandomRegexp(Random());
diff --git a/src/Lucene.Net.Tests/Search/TestSearchAfter.cs b/src/Lucene.Net.Tests/Search/TestSearchAfter.cs
index 1f32b6c..3221aa2 100644
--- a/src/Lucene.Net.Tests/Search/TestSearchAfter.cs
+++ b/src/Lucene.Net.Tests/Search/TestSearchAfter.cs
@@ -62,7 +62,7 @@ namespace Lucene.Net.Search
         private IndexSearcher Searcher;
 
         // LUCENENET specific - need to execute this AFTER the base setup, or it won't be right
-        //internal bool supportsDocValues = Codec.Default.Name.Equals("Lucene3x") == false;
+        //internal bool supportsDocValues = Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal) == false;
         private int Iter;
         private IList<SortField> AllSortFields;
 
@@ -73,7 +73,7 @@ namespace Lucene.Net.Search
 
             // LUCENENET specific: Moved this logic here to ensure that it is executed
             // after the class is setup - a field is way to early to execute this.
-            bool supportsDocValues = Codec.Default.Name.Equals("Lucene3x") == false;
+            bool supportsDocValues = Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal) == false;
 
             AllSortFields = new List<SortField>(Arrays.AsList(new SortField[] {
 #pragma warning disable 612,618
diff --git a/src/Lucene.Net.Tests/Search/TestSimilarityProvider.cs b/src/Lucene.Net.Tests/Search/TestSimilarityProvider.cs
index 67d95d6..f9db0e8 100644
--- a/src/Lucene.Net.Tests/Search/TestSimilarityProvider.cs
+++ b/src/Lucene.Net.Tests/Search/TestSimilarityProvider.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Documents;
 using Lucene.Net.Support;
 using NUnit.Framework;
+using System;
 
 namespace Lucene.Net.Search
 {
@@ -118,7 +119,7 @@ namespace Lucene.Net.Search
 
             public override Similarity Get(string field)
             {
-                if (field.Equals("foo"))
+                if (field.Equals("foo", StringComparison.Ordinal))
                 {
                     return Sim1;
                 }
diff --git a/src/Lucene.Net.Tests/Support/IO/TestStreamTokenizer.cs b/src/Lucene.Net.Tests/Support/IO/TestStreamTokenizer.cs
index 5e50163..a3e1454 100644
--- a/src/Lucene.Net.Tests/Support/IO/TestStreamTokenizer.cs
+++ b/src/Lucene.Net.Tests/Support/IO/TestStreamTokenizer.cs
@@ -106,7 +106,7 @@ namespace Lucene.Net.Support.IO
                    .NextToken() == StreamTokenizer.TT_NUMBER
                    && st.NumberValue == 8.0);
             assertTrue("the next token returned should be the quote character",
-                   st.NextToken() == 39 && st.StringValue.equals("h"));
+                   st.NextToken() == 39 && st.StringValue.Equals("h", StringComparison.Ordinal));
         }
 
         /**
@@ -119,7 +119,7 @@ namespace Lucene.Net.Support.IO
             // by default end of line characters are not significant
             assertTrue("nextToken did not return d",
                    st.NextToken() == StreamTokenizer.TT_WORD
-                   && st.StringValue.equals("d"));
+                   && st.StringValue.Equals("d", StringComparison.Ordinal));
             assertTrue("nextToken did not return 8",
                    st.NextToken() == StreamTokenizer.TT_NUMBER
                    && st.NumberValue == 8.0);
@@ -130,7 +130,7 @@ namespace Lucene.Net.Support.IO
             // end of line characters are significant
             assertTrue("nextToken did not return d",
                    st.NextToken() == StreamTokenizer.TT_WORD
-                   && st.StringValue.equals("d"));
+                   && st.StringValue.Equals("d", StringComparison.Ordinal));
             assertTrue("nextToken is the end of line",
                    st.NextToken() == StreamTokenizer.TT_EOL);
         }
@@ -199,7 +199,7 @@ namespace Lucene.Net.Support.IO
             st.NextToken();
             assertTrue("Wrong Token type6: " + st.TokenType, st.TokenType == '\'');
             assertTrue("Wrong Token type7: " + st.TokenType, st.StringValue
-                   .equals("Hello World"));
+                   .Equals("Hello World", StringComparison.Ordinal));
             st.NextToken();
             assertTrue("Wrong Token type8: " + st.TokenType, st.TokenType == -1);
 
@@ -212,7 +212,7 @@ namespace Lucene.Net.Support.IO
 
                 assertTrue("Wrong token 1,1",
                        s.NextToken() == StreamTokenizer.TT_WORD
-                       && s.StringValue.equals("hello"));
+                       && s.StringValue.Equals("hello", StringComparison.Ordinal));
 
                 assertTrue("Wrong token 1,2", s.NextToken() == '\n');
 
@@ -445,8 +445,8 @@ namespace Lucene.Net.Support.IO
             setTest("ABC Hello World");
             st.NextToken();
             assertTrue("toString failed." + st.toString(),
-                       st.toString().equals(
-                                "Token[ABC], line 1"));
+                       st.toString().Equals(
+                                "Token[ABC], line 1", StringComparison.Ordinal));
 
             // Regression test for HARMONY-4070
             byte[] data = new byte[] { (byte)'-' };
@@ -498,10 +498,10 @@ namespace Lucene.Net.Support.IO
             st.WordChars('\'', '\'');
             st.NextToken();
             assertTrue("WordChars failed for whitespace: " + st.StringValue, st.StringValue
-                       .equals("Hello World"));
+                       .Equals("Hello World", StringComparison.Ordinal));
             st.NextToken();
             assertTrue("WordChars failed for quote1: " + st.StringValue, st.StringValue
-                       .equals("\'Hello World\' Hello\' World"));
+                       .Equals("\'Hello World\' Hello\' World", StringComparison.Ordinal));
         }
 
         private void setTest(string s)
diff --git a/src/Lucene.Net.Tests/Support/TestDictionaryExtensions.cs b/src/Lucene.Net.Tests/Support/TestDictionaryExtensions.cs
index 7a8a258..839497d 100644
--- a/src/Lucene.Net.Tests/Support/TestDictionaryExtensions.cs
+++ b/src/Lucene.Net.Tests/Support/TestDictionaryExtensions.cs
@@ -153,15 +153,15 @@ namespace Lucene.Net.Tests.Support
             Dictionary<string, string> prop = null;
             prop = new Dictionary<string, string>();
             prop.Load(new MemoryStream("=".getBytes()));
-            assertTrue("Failed to add empty key", prop.get("").equals(""));
+            assertTrue("Failed to add empty key", prop.get("").Equals("", StringComparison.Ordinal));
 
             prop = new Dictionary<string, string>();
             prop.Load(new MemoryStream("=\r\n".getBytes()));
-            assertTrue("Failed to add empty key", prop.get("").equals(""));
+            assertTrue("Failed to add empty key", prop.get("").Equals("", StringComparison.Ordinal));
 
             prop = new Dictionary<string, string>();
             prop.Load(new MemoryStream("=\n\r".getBytes()));
-            assertTrue("Failed to add empty key", prop.get("").equals(""));
+            assertTrue("Failed to add empty key", prop.get("").Equals("", StringComparison.Ordinal));
         }
 
         /**
@@ -216,7 +216,7 @@ namespace Lucene.Net.Tests.Support
                 {
                     nextKey = e.Current;
                     assertTrue("Stored property list not equal to original", myProps2
-                        .getProperty(nextKey).equals(myProps.getProperty(nextKey)));
+                        .getProperty(nextKey).Equals(myProps.getProperty(nextKey), StringComparison.Ordinal));
                 }
             }
         }
diff --git a/src/Lucene.Net.Tests/Support/TestEquatableList.cs b/src/Lucene.Net.Tests/Support/TestEquatableList.cs
index a4d2b97..30079d0 100644
--- a/src/Lucene.Net.Tests/Support/TestEquatableList.cs
+++ b/src/Lucene.Net.Tests/Support/TestEquatableList.cs
@@ -108,7 +108,7 @@ namespace Lucene.Net.Support
             var val1 = "\uA0A2\uA0A2";
             var val2 = string.Empty;
 
-            Assert.IsFalse(val1.Equals(val2));
+            Assert.IsFalse(val1.Equals(val2, StringComparison.Ordinal));
 
             var hash1 = val1.GetHashCode();
             var hash2 = val2.GetHashCode();
diff --git a/src/Lucene.Net.Tests/Support/TestEquatableSet.cs b/src/Lucene.Net.Tests/Support/TestEquatableSet.cs
index 2ac0798..5157466 100644
--- a/src/Lucene.Net.Tests/Support/TestEquatableSet.cs
+++ b/src/Lucene.Net.Tests/Support/TestEquatableSet.cs
@@ -108,7 +108,7 @@ namespace Lucene.Net.Support
             var val1 = "\uA0A2\uA0A2";
             var val2 = string.Empty;
 
-            Assert.IsFalse(val1.Equals(val2));
+            Assert.IsFalse(val1.Equals(val2, StringComparison.Ordinal));
 
             var hash1 = val1.GetHashCode();
             var hash2 = val2.GetHashCode();
diff --git a/src/Lucene.Net.Tests/Support/TestStringTokenizer.cs b/src/Lucene.Net.Tests/Support/TestStringTokenizer.cs
index 5de8588..e04d066 100644
--- a/src/Lucene.Net.Tests/Support/TestStringTokenizer.cs
+++ b/src/Lucene.Net.Tests/Support/TestStringTokenizer.cs
@@ -48,7 +48,7 @@ namespace Lucene.Net.Support
             // java.lang.String)
             StringTokenizer st = new StringTokenizer("This:is:a:test:String", ":");
             assertTrue("Created incorrect tokenizer", st.CountTokens() == 5
-                    && (st.NextToken().equals("This")));
+                    && (st.NextToken().Equals("This", StringComparison.Ordinal)));
         }
 
         /**
@@ -64,7 +64,7 @@ namespace Lucene.Net.Support
                     true);
             st.NextToken();
             assertTrue("Created incorrect tokenizer", st.CountTokens() == 8
-                    && (st.NextToken().equals(":")));
+                    && (st.NextToken().Equals(":", StringComparison.Ordinal)));
         }
 
         /**
diff --git a/src/Lucene.Net.Tests/TestExternalCodecs.cs b/src/Lucene.Net.Tests/TestExternalCodecs.cs
index 1b72ea3..ffcef56 100644
--- a/src/Lucene.Net.Tests/TestExternalCodecs.cs
+++ b/src/Lucene.Net.Tests/TestExternalCodecs.cs
@@ -52,11 +52,11 @@ namespace Lucene.Net
 
             public override PostingsFormat GetPostingsFormatForField(string field)
             {
-                if (field.Equals("field2") || field.Equals("id"))
+                if (field.Equals("field2", StringComparison.Ordinal) || field.Equals("id", StringComparison.Ordinal))
                 {
                     return PulsingFormat;
                 }
-                else if (field.Equals("field1"))
+                else if (field.Equals("field1", StringComparison.Ordinal))
                 {
                     return DefaultFormat;
                 }
diff --git a/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs b/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs
index f23d2a2..1365170 100644
--- a/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs
+++ b/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs
@@ -238,7 +238,7 @@ namespace Lucene.Net.Util.Automaton
                 sb.Append(s[i]);
                 sb.Append(s.Substring(i + 2, s.Length - (i + 2)));
                 string st = sb.ToString();
-                if (!st.Equals(s))
+                if (!st.Equals(s, StringComparison.Ordinal))
                 {
                     list.Add(BasicAutomata.MakeString(st));
                 }
diff --git a/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs b/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs
index 842297e..8b58b93 100644
--- a/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs
+++ b/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs
@@ -721,41 +721,41 @@ namespace Lucene.Net.Util.Fst
             int idx = 0;
             while (idx < args.Length)
             {
-                if (args[idx].Equals("-prune"))
+                if (args[idx].Equals("-prune", StringComparison.Ordinal))
                 {
                     prune = Convert.ToInt32(args[1 + idx]);
                     idx++;
                 }
-                else if (args[idx].Equals("-limit"))
+                else if (args[idx].Equals("-limit", StringComparison.Ordinal))
                 {
                     limit = Convert.ToInt32(args[1 + idx]);
                     idx++;
                 }
-                else if (args[idx].Equals("-utf8"))
+                else if (args[idx].Equals("-utf8", StringComparison.Ordinal))
                 {
                     inputMode = 0;
                 }
-                else if (args[idx].Equals("-utf32"))
+                else if (args[idx].Equals("-utf32", StringComparison.Ordinal))
                 {
                     inputMode = 1;
                 }
-                else if (args[idx].Equals("-docFreq"))
+                else if (args[idx].Equals("-docFreq", StringComparison.Ordinal))
                 {
                     storeDocFreqs = true;
                 }
-                else if (args[idx].Equals("-noArcArrays"))
+                else if (args[idx].Equals("-noArcArrays", StringComparison.Ordinal))
                 {
                     noArcArrays = true;
                 }
-                else if (args[idx].Equals("-ords"))
+                else if (args[idx].Equals("-ords", StringComparison.Ordinal))
                 {
                     storeOrds = true;
                 }
-                else if (args[idx].Equals("-noverify"))
+                else if (args[idx].Equals("-noverify", StringComparison.Ordinal))
                 {
                     verify = false;
                 }
-                else if (args[idx].Equals("-pack"))
+                else if (args[idx].Equals("-pack", StringComparison.Ordinal))
                 {
                     doPack = true;
                 }
diff --git a/src/Lucene.Net.Tests/Util/TestFilterIterator.cs b/src/Lucene.Net.Tests/Util/TestFilterIterator.cs
index 19a6f1e..7cd8728 100644
--- a/src/Lucene.Net.Tests/Util/TestFilterIterator.cs
+++ b/src/Lucene.Net.Tests/Util/TestFilterIterator.cs
@@ -77,7 +77,7 @@ namespace Lucene.Net.Util
 
             protected override bool PredicateFunction(string s)
             {
-                return "a".Equals(s);
+                return "a".Equals(s, StringComparison.Ordinal);
             }
         }
 
@@ -103,7 +103,7 @@ namespace Lucene.Net.Util
 
             protected override bool PredicateFunction(string s)
             {
-                return "a".Equals(s);
+                return "a".Equals(s, StringComparison.Ordinal);
             }
         }
 
@@ -128,7 +128,7 @@ namespace Lucene.Net.Util
 
             protected override bool PredicateFunction(string s)
             {
-                return "b".Equals(s);
+                return "b".Equals(s, StringComparison.Ordinal);
             }
         }
 
@@ -154,7 +154,7 @@ namespace Lucene.Net.Util
 
             protected override bool PredicateFunction(string s)
             {
-                return "b".Equals(s);
+                return "b".Equals(s, StringComparison.Ordinal);
             }
         }
 
diff --git a/src/Lucene.Net.Tests/Util/TestQueryBuilder.cs b/src/Lucene.Net.Tests/Util/TestQueryBuilder.cs
index e61526b..ddfaefc 100644
--- a/src/Lucene.Net.Tests/Util/TestQueryBuilder.cs
+++ b/src/Lucene.Net.Tests/Util/TestQueryBuilder.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Analysis;
 using Lucene.Net.Analysis.TokenAttributes;
 using NUnit.Framework;
+using System;
 using System.IO;
 
 namespace Lucene.Net.Util
@@ -173,7 +174,7 @@ namespace Lucene.Net.Util
 
                 if (m_input.IncrementToken())
                 {
-                    AddSynonym = TermAtt.ToString().Equals("dogs");
+                    AddSynonym = TermAtt.ToString().Equals("dogs", StringComparison.Ordinal);
                     return true;
                 }
                 else
@@ -320,7 +321,7 @@ namespace Lucene.Net.Util
 
                 if (m_input.IncrementToken())
                 {
-                    AddSynonym = TermAtt.ToString().Equals("国");
+                    AddSynonym = TermAtt.ToString().Equals("国", StringComparison.Ordinal);
                     return true;
                 }
                 else
diff --git a/src/Lucene.Net/Analysis/Token.cs b/src/Lucene.Net/Analysis/Token.cs
index d913196..199d300 100644
--- a/src/Lucene.Net/Analysis/Token.cs
+++ b/src/Lucene.Net/Analysis/Token.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.TokenAttributes;
+using System;
 using System.Reflection;
 using Attribute = Lucene.Net.Util.Attribute;
 using AttributeSource = Lucene.Net.Util.AttributeSource;
@@ -432,7 +433,7 @@ namespace Lucene.Net.Analysis
                     endOffset == other.endOffset && 
                     flags == other.flags && 
                     positionIncrement == other.positionIncrement && 
-                    (type == null ? other.type == null : type.Equals(other.type, System.StringComparison.Ordinal)) && 
+                    (type == null ? other.type == null : type.Equals(other.type, StringComparison.Ordinal)) && 
                     (payload == null ? other.payload == null : payload.Equals(other.payload)) && 
                     base.Equals(obj)
                 );
diff --git a/src/Lucene.Net/Index/UpgradeIndexMergePolicy.cs b/src/Lucene.Net/Index/UpgradeIndexMergePolicy.cs
index b75fffa..9ff1396 100644
--- a/src/Lucene.Net/Index/UpgradeIndexMergePolicy.cs
+++ b/src/Lucene.Net/Index/UpgradeIndexMergePolicy.cs
@@ -65,7 +65,7 @@ namespace Lucene.Net.Index
 
         /// <summary>
         /// Returns <c>true</c> if the given segment should be upgraded. The default implementation
-        /// will return <c>!Constants.LUCENE_MAIN_VERSION.Equals(si.Version)</c>,
+        /// will return <c>!Constants.LUCENE_MAIN_VERSION.Equals(si.Info.Version, StringComparison.Ordinal)</c>,
         /// so all segments created with a different version number than this Lucene version will
         /// get upgraded.
         /// </summary>
diff --git a/src/Lucene.Net/Support/Arrays.cs b/src/Lucene.Net/Support/Arrays.cs
index 1d7a6c7..10ad3c0 100644
--- a/src/Lucene.Net/Support/Arrays.cs
+++ b/src/Lucene.Net/Support/Arrays.cs
@@ -102,7 +102,7 @@ namespace Lucene.Net.Support
         /// to one another. The two arrays are considered equal if both arrays
         /// contain the same number of elements, and all corresponding pairs of
         /// elements in the two arrays are equal. Two objects e1 and e2 are
-        /// considered equal if (e1==null ? e2==null : e1.equals(e2)). In other
+        /// considered equal if (e1==null ? e2==null : e1.Equals(e2)). In other
         /// words, the two arrays are equal if they contain the same elements in
         /// the same order. Also, two array references are considered equal if
         /// both are null.
diff --git a/src/Lucene.Net/Support/AssemblyExtensions.cs b/src/Lucene.Net/Support/AssemblyExtensions.cs
index 5236d14..7b6f9e0 100644
--- a/src/Lucene.Net/Support/AssemblyExtensions.cs
+++ b/src/Lucene.Net/Support/AssemblyExtensions.cs
@@ -60,7 +60,7 @@ namespace Lucene.Net.Support
             if (!resourceCache.TryGetValue(key, out resourceName))
             {
                 string[] resourceNames = assembly.GetManifestResourceNames();
-                resourceName = resourceNames.Where(x => x.Equals(name)).FirstOrDefault();
+                resourceName = resourceNames.Where(x => x.Equals(name, StringComparison.Ordinal)).FirstOrDefault();
 
                 // If resourceName is not null, we have an exact match, don't search
                 if (resourceName == null)
@@ -101,7 +101,7 @@ namespace Lucene.Net.Support
             if (!resourceNames.Contains(resourceName))
             {
                 string nameToFind = null;
-                while (resourceName.Length > 0 && resourceName.Contains('.') && (!(string.IsNullOrEmpty(prefix)) || resourceName.Equals(exactResourceName)))
+                while (resourceName.Length > 0 && resourceName.Contains('.') && (!(string.IsNullOrEmpty(prefix)) || resourceName.Equals(exactResourceName, StringComparison.Ordinal)))
                 {
                     nameToFind = string.IsNullOrEmpty(prefix)
                         ? resourceName
@@ -148,7 +148,7 @@ namespace Lucene.Net.Support
 
                 var other = obj as TypeAndResource;
                 return this.type.Equals(other.type)
-                    && this.name.Equals(other.name);
+                    && this.name.Equals(other.name, StringComparison.Ordinal);
             }
 
             public override int GetHashCode()


Mime
View raw message