lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [24/50] [abbrv] lucenenet git commit: SWEEP: Changed remaining string CompareTo() methods to CompareToOrdinal()
Date Wed, 15 Mar 2017 23:50:06 GMT
SWEEP: Changed remaining string CompareTo() methods to CompareToOrdinal()


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

Branch: refs/heads/api-work
Commit: 087a818fc4031eeb359962a4218bed2fc6f25751
Parents: d6aa7d7
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Mar 15 04:26:05 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Mar 15 16:03:30 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs            | 3 ++-
 src/Lucene.Net.Misc/Misc/HighFreqTerms.cs                       | 5 +++--
 .../Analysis/Core/TestRandomChains.cs                           | 2 +-
 src/Lucene.Net.Tests.Facet/TestDrillSideways.cs                 | 2 +-
 src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs    | 3 ++-
 src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs          | 5 +++--
 .../Suggest/Analyzing/FuzzySuggesterTest.cs                     | 2 +-
 src/Lucene.Net.Tests/Index/TestCodecs.cs                        | 2 +-
 src/Lucene.Net.Tests/Index/TestStressIndexing2.cs               | 2 +-
 src/Lucene.Net.Tests/Support/C5/SupportClasses.cs               | 2 +-
 10 files changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
index 2f76c7c..1a2592f 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Index;
 using Lucene.Net.Store;
+using Lucene.Net.Support;
 using Lucene.Net.Util;
 using System;
 using System.Collections.Generic;
@@ -119,7 +120,7 @@ namespace Lucene.Net.Codecs.BlockTerms
 
         public override TermsConsumer AddField(FieldInfo field)
         {
-            Debug.Assert(currentField == null || currentField.Name.CompareTo(field.Name)
< 0);
+            Debug.Assert(currentField == null || currentField.Name.CompareToOrdinal(field.Name)
< 0);
 
             currentField = field;
             var fiw = termsIndexWriter.AddField(field, m_output.FilePointer);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs
index f48f37e..7256353 100644
--- a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs
+++ b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Index;
 using Lucene.Net.Store;
+using Lucene.Net.Support;
 using Lucene.Net.Util;
 using System;
 using System.Collections.Generic;
@@ -154,7 +155,7 @@ namespace Lucene.Net.Misc
                 int res = a.DocFreq.CompareTo(b.DocFreq);
                 if (res == 0)
                 {
-                    res = a.Field.CompareTo(b.Field);
+                    res = a.Field.CompareToOrdinal(b.Field);
                     if (res == 0)
                     {
                         res = a.termtext.CompareTo(b.termtext);
@@ -174,7 +175,7 @@ namespace Lucene.Net.Misc
                 int res = a.TotalTermFreq.CompareTo(b.TotalTermFreq);
                 if (res == 0)
                 {
-                    res = a.Field.CompareTo(b.Field);
+                    res = a.Field.CompareToOrdinal(b.Field);
                     if (res == 0)
                     {
                         res = a.termtext.CompareTo(b.termtext);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
index 3cfc69c..d810a4a 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
@@ -256,7 +256,7 @@ namespace Lucene.Net.Analysis.Core
             {
                 // LUCENENET TODO: Need to ensure we have the right sort order
                 // original: arg0.toGenericString().compareTo(arg1.toGenericString());
-                return arg0.ToString().CompareTo(arg1.ToString());
+                return arg0.ToString().CompareToOrdinal(arg1.ToString());
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
index 0d3d0ab..636a0e5 100644
--- a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
+++ b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
@@ -382,7 +382,7 @@ namespace Lucene.Net.Facet
 
             public virtual int CompareTo(Doc other)
             {
-                return id.CompareTo(other.id);
+                return id.CompareToOrdinal(other.id);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
index 13495cb..73c4424 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function;
 using Lucene.Net.Search;
+using Lucene.Net.Support;
 using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries.Function
@@ -85,7 +86,7 @@ namespace Lucene.Net.Tests.Queries.Function
                 string resID = s.Doc(h[i].Doc).Get(ID_FIELD);
                 Log(i + ".   score=" + h[i].Score + "  -  " + resID);
                 Log(s.Explain(functionQuery, h[i].Doc));
-                assertTrue("res id " + resID + " should be < prev res id " + prevID, resID.CompareTo(prevID)
< 0);
+                assertTrue("res id " + resID + " should be < prev res id " + prevID, resID.CompareToOrdinal(prevID)
< 0);
                 prevID = resID;
             }
             r.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
index 3067d63..981acbd 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
@@ -2,6 +2,7 @@
 using Lucene.Net.Queries.Function;
 using Lucene.Net.Queries.Function.ValueSources;
 using Lucene.Net.Search;
+using Lucene.Net.Support;
 using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries.Function
@@ -77,11 +78,11 @@ namespace Lucene.Net.Tests.Queries.Function
                 Log(s.Explain(q, h[i].Doc));
                 if (inOrder)
                 {
-                    assertTrue("res id " + resID + " should be < prev res id " + prevID,
resID.CompareTo(prevID) < 0);
+                    assertTrue("res id " + resID + " should be < prev res id " + prevID,
resID.CompareToOrdinal(prevID) < 0);
                 }
                 else
                 {
-                    assertTrue("res id " + resID + " should be > prev res id " + prevID,
resID.CompareTo(prevID) > 0);
+                    assertTrue("res id " + resID + " should be > prev res id " + prevID,
resID.CompareToOrdinal(prevID) > 0);
                 }
                 prevID = resID;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
index 6a9d6c4..8491df7 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
@@ -584,7 +584,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
 
             public int CompareTo(TermFreqPayload2 other)
             {
-                int cmp = analyzedForm.CompareTo(other.analyzedForm);
+                int cmp = analyzedForm.CompareToOrdinal(other.analyzedForm);
                 if (cmp != 0)
                 {
                     return cmp;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Tests/Index/TestCodecs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestCodecs.cs b/src/Lucene.Net.Tests/Index/TestCodecs.cs
index 7a0282e..24a3e7c 100644
--- a/src/Lucene.Net.Tests/Index/TestCodecs.cs
+++ b/src/Lucene.Net.Tests/Index/TestCodecs.cs
@@ -205,7 +205,7 @@ namespace Lucene.Net.Index
 
             public int CompareTo(FieldData other)
             {
-                return FieldInfo.Name.CompareTo(other.FieldInfo.Name);
+                return FieldInfo.Name.CompareToOrdinal(other.FieldInfo.Name);
             }
 
             public virtual void Write(FieldsConsumer consumer)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs b/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs
index fc9b52a..43caffd 100644
--- a/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs
+++ b/src/Lucene.Net.Tests/Index/TestStressIndexing2.cs
@@ -158,7 +158,7 @@ namespace Lucene.Net.Index
 
             public virtual int Compare(IIndexableField o1, IIndexableField o2)
             {
-                return o1.Name.CompareTo(o2.Name);
+                return o1.Name.CompareToOrdinal(o2.Name);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/087a818f/src/Lucene.Net.Tests/Support/C5/SupportClasses.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Support/C5/SupportClasses.cs b/src/Lucene.Net.Tests/Support/C5/SupportClasses.cs
index 3f278b1..6303c71 100644
--- a/src/Lucene.Net.Tests/Support/C5/SupportClasses.cs
+++ b/src/Lucene.Net.Tests/Support/C5/SupportClasses.cs
@@ -31,7 +31,7 @@ namespace Lucene.Net.Support
     {
         public int Compare(string a, string b)
         {
-            return a.CompareTo(b);
+            return a.CompareToOrdinal(b);
         }
 
 


Mime
View raw message