lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [23/50] [abbrv] lucenenet git commit: SWEEP: Fixed issues with string .Equals()
Date Wed, 15 Mar 2017 23:50:05 GMT
SWEEP: Fixed issues with string .Equals()


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

Branch: refs/heads/api-work
Commit: d6aa7d7a688c0f3ae622021144ea5fa8d89dcdb6
Parents: d291874
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Mar 15 04:24:54 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Mar 15 16:03:29 2017 +0700

----------------------------------------------------------------------
 .../Analysis/CommonGrams/CommonGramsFilterFactory.cs  |  2 +-
 .../Analysis/Compound/Hyphenation/PatternParser.cs    |  2 +-
 .../Analysis/Core/StopFilterFactory.cs                |  4 ++--
 .../Collation/CollationKeyFilterFactory.cs            | 14 +++++++-------
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d6aa7d7a/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs
b/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs
index 333ac68..b865216 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs
@@ -59,7 +59,7 @@ namespace Lucene.Net.Analysis.CommonGrams
         {
             if (commonWordFiles != null)
             {
-                if ("snowball".Equals(format, StringComparison.CurrentCultureIgnoreCase))
+                if ("snowball".Equals(format, StringComparison.OrdinalIgnoreCase))
                 {
                     commonWords = GetSnowballWordSet(loader, commonWordFiles, ignoreCase);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d6aa7d7a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
----------------------------------------------------------------------
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 4070466..4e1dac3 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
@@ -400,7 +400,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(), StringComparison.OrdinalIgnoreCase))
+                if (dtdFilename.Equals(absoluteUri.Segments.LastOrDefault()))
                 {
                     var qualifedDtdFilename = string.Concat(GetType().Namespace, ".", dtdFilename);
                     return GetType().Assembly.GetManifestResourceStream(qualifedDtdFilename);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d6aa7d7a/src/Lucene.Net.Analysis.Common/Analysis/Core/StopFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Core/StopFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Core/StopFilterFactory.cs
index 1f0c5db..bb9ca76 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Core/StopFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Core/StopFilterFactory.cs
@@ -96,11 +96,11 @@ namespace Lucene.Net.Analysis.Core
         {
             if (stopWordFiles != null)
             {
-                if (FORMAT_WORDSET.Equals(format, StringComparison.CurrentCultureIgnoreCase))
+                if (FORMAT_WORDSET.Equals(format, StringComparison.OrdinalIgnoreCase))
                 {
                     stopWords = GetWordSet(loader, stopWordFiles, ignoreCase);
                 }
-                else if (FORMAT_SNOWBALL.Equals(format, StringComparison.CurrentCultureIgnoreCase))
+                else if (FORMAT_SNOWBALL.Equals(format, StringComparison.OrdinalIgnoreCase))
                 {
                     stopWords = GetSnowballWordSet(loader, stopWordFiles, ignoreCase);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d6aa7d7a/src/Lucene.Net.Analysis.Common/Collation/CollationKeyFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Collation/CollationKeyFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Collation/CollationKeyFilterFactory.cs
index 0859eda..6599f17 100644
--- a/src/Lucene.Net.Analysis.Common/Collation/CollationKeyFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Collation/CollationKeyFilterFactory.cs
@@ -123,19 +123,19 @@ namespace Lucene.Net.Collation
 			// set the strength flag, otherwise it will be the default.
 			if (this.strength != null)
 			{
-				if (this.strength.Equals("primary", StringComparison.CurrentCultureIgnoreCase))
+				if (this.strength.Equals("primary", StringComparison.OrdinalIgnoreCase))
 				{
 					this.collator.Strength = CollationStrength.Primary;
 				}
-				else if (this.strength.Equals("secondary", StringComparison.CurrentCultureIgnoreCase))
+				else if (this.strength.Equals("secondary", StringComparison.OrdinalIgnoreCase))
 				{
 					this.collator.Strength = CollationStrength.Secondary;
 				}
-				else if (this.strength.Equals("tertiary", StringComparison.CurrentCultureIgnoreCase))
+				else if (this.strength.Equals("tertiary", StringComparison.OrdinalIgnoreCase))
 				{
                     this.collator.Strength = CollationStrength.Tertiary;
 				}
-				else if (this.strength.Equals("identical", StringComparison.CurrentCultureIgnoreCase))
+				else if (this.strength.Equals("identical", StringComparison.OrdinalIgnoreCase))
 				{
                     this.collator.Strength = CollationStrength.Identical;
 				}
@@ -150,15 +150,15 @@ namespace Lucene.Net.Collation
             // set the decomposition flag, otherwise it will be the default.
             if (this.decomposition != null)
             {
-                if (this.decomposition.Equals("no", StringComparison.CurrentCultureIgnoreCase))
+                if (this.decomposition.Equals("no", StringComparison.OrdinalIgnoreCase))
                 {
                     this.collator.NormalizationMode = NormalizationMode.Default; // .Decomposition
= Collator.NoDecomposition;
                 }
-                else if (this.decomposition.Equals("canonical", StringComparison.CurrentCultureIgnoreCase))
+                else if (this.decomposition.Equals("canonical", StringComparison.OrdinalIgnoreCase))
                 {
                     this.collator.NormalizationMode = NormalizationMode.Off; //.Decomposition
= Collator.CannonicalDecomposition;
                 }
-                else if (this.decomposition.Equals("full", StringComparison.CurrentCultureIgnoreCase))
+                else if (this.decomposition.Equals("full", StringComparison.OrdinalIgnoreCase))
                 {
                     this.collator.NormalizationMode = NormalizationMode.On; //.Decomposition
= Collator.FullDecomposition;
                 }


Mime
View raw message