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 787ac89441b00731382ffd6c4be806e8d2dddfad Author: Shad Storhaug <[email protected]> AuthorDate: Wed Dec 15 10:47:13 2021 +0700 BUG: Lucene.Net.Support.Collections.ReverseComparer<T>: Replaced CaseInsensitiveComparer with J2N.Collections.Generic.Comparer<T>. This only affects tests. --- src/Lucene.Net/Support/Collections.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/Lucene.Net/Support/Collections.cs b/src/Lucene.Net/Support/Collections.cs index ebc077a..fb2787b 100644 --- a/src/Lucene.Net/Support/Collections.cs +++ b/src/Lucene.Net/Support/Collections.cs @@ -217,28 +217,14 @@ namespace Lucene.Net.Support #region ReverseComparer - //private class ReverseComparer : IComparer<IComparable> - //{ - // internal static readonly ReverseComparer REVERSE_ORDER = new ReverseComparer(); - - - // public int Compare(IComparable c1, IComparable c2) - // { - // return c2.CompareTo(c1); - // } - //} - - // LUCENENET NOTE: When consolidating this, it turns out that only the - // CaseInsensitiveComparer works correctly in .NET (not sure why). - // So, this hybrid was made from the original Java implementation and the - // original implemenation (above) that used CaseInsensitiveComparer. private class ReverseComparer<T> : IComparer<T> { internal static readonly ReverseComparer<T> REVERSE_ORDER = new ReverseComparer<T>(); public int Compare(T x, T y) { - return CaseInsensitiveComparer.Default.Compare(y, x); + // LUCENENET specific: Use J2N's Comparer<T> to mimic Java comparison behavior + return JCG.Comparer<T>.Default.Compare(y, x); } }
