lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [30/50] [abbrv] lucenenet git commit: BUG: Lucene.Net.Codecs.SimpleText.SimpleTextTermVectorsReader: Reworked logic to use the boolean result of MoveNext() instead of relying on exceptions. This was causing Lucene.Net.Core.Tests.Index.TestDuelingCodecs.T
Date Sun, 05 Mar 2017 11:49:09 GMT
BUG: Lucene.Net.Codecs.SimpleText.SimpleTextTermVectorsReader: Reworked logic to use the boolean
result of MoveNext() instead of relying on exceptions. This was causing Lucene.Net.Core.Tests.Index.TestDuelingCodecs.TestEquals()
to intermittently return null for the left parameter.


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

Branch: refs/heads/api-work
Commit: 3bff8104af7f9521a5ccb336a8d1c591ae43230d
Parents: 99a4b35
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sat Mar 4 15:59:06 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Mar 5 17:08:43 2017 +0700

----------------------------------------------------------------------
 .../SimpleText/SimpleTextTermVectorsReader.cs         | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3bff8104/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
index 29fe3d1..d6f29cd 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
@@ -397,14 +397,13 @@ namespace Lucene.Net.Codecs.SimpleText
 
                 _iterator = newTerms.EntrySet().GetEnumerator();
 
-                try
+                if (!_iterator.MoveNext())
                 {
-                    _iterator.MoveNext();
-                    return _iterator.Current.Key.Equals(text) ? SeekStatus.FOUND : SeekStatus.NOT_FOUND;
+                    return SeekStatus.END;
                 }
-                catch
+                else
                 {
-                    return SeekStatus.END;
+                    return _iterator.Current.Key.Equals(text) ? SeekStatus.FOUND : SeekStatus.NOT_FOUND;
                 }
             }
 
@@ -415,13 +414,12 @@ namespace Lucene.Net.Codecs.SimpleText
 
             public override BytesRef Next()
             {
-                try
+                if (_iterator.MoveNext())
                 {
-                    _iterator.MoveNext();
                     _current = _iterator.Current;
                     return _current.Key;
                 }
-                catch
+                else
                 {
                     return null;
                 }


Mime
View raw message