BUG: Lucene.Net.Core.Util.Automaton.Transition.ToString(): Corrected implementation to add the code point as text rather than appending the number
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/d3151a3b Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/d3151a3b Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/d3151a3b Branch: refs/heads/api-work Commit: d3151a3b46ba33faa9f7895629ca04cb367c8788 Parents: 8c1a3f0 Author: Shad Storhaug <[email protected]> Authored: Mon Mar 6 14:21:19 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Mon Mar 6 18:08:09 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Util/Automaton/Transition.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d3151a3b/src/Lucene.Net.Core/Util/Automaton/Transition.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Util/Automaton/Transition.cs b/src/Lucene.Net.Core/Util/Automaton/Transition.cs index bf26580..4b6ffe3 100644 --- a/src/Lucene.Net.Core/Util/Automaton/Transition.cs +++ b/src/Lucene.Net.Core/Util/Automaton/Transition.cs @@ -1,3 +1,4 @@ +using Lucene.Net.Support; using System.Collections.Generic; using System.Diagnostics; using System.Text; @@ -156,7 +157,7 @@ namespace Lucene.Net.Util.Automaton { if (c >= 0x21 && c <= 0x7e && c != '\\' && c != '"') { - b.Append(c); + b.AppendCodePoint(c); } else { @@ -230,7 +231,8 @@ namespace Lucene.Net.Util.Automaton { public int Compare(Transition t1, Transition t2) { - if (t1.to != t2.to) + //if (t1.to != t2.to) + if (!ReferenceEquals(t1.to, t2.to)) { if (t1.to.number < t2.to.number) { @@ -284,7 +286,8 @@ namespace Lucene.Net.Util.Automaton { return 1; } - if (t1.to != t2.to) + //if (t1.to != t2.to) + if (!ReferenceEquals(t1.to, t2.to)) { if (t1.to.number < t2.to.number) {
