Repository: lucenenet Updated Branches: refs/heads/api-work e103f24e7 -> adabd1ea7
BUG: Lucene.Net.Core.Search.IndexSearcher: Added missing return true statement to ExecutionHelper<T>.MoveNext() and cleaned up commented code. This fixes Lucene.Net.Tests.Index.TestIndexReaderWriter.TestDuringAddIndexes() and any other tests that rely on Lucene.Net.TestFramework.Util.LuceneTestCase.NewSearcher() from random failures Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/c323c319 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/c323c319 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/c323c319 Branch: refs/heads/api-work Commit: c323c319c18f5d4137cba5d3bd72bc81bccf0cca Parents: e103f24 Author: Shad Storhaug <[email protected]> Authored: Wed Mar 22 16:52:10 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Wed Mar 22 16:52:10 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Search/IndexSearcher.cs | 44 +++++------------------- 1 file changed, 9 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c323c319/src/Lucene.Net.Core/Search/IndexSearcher.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Search/IndexSearcher.cs b/src/Lucene.Net.Core/Search/IndexSearcher.cs index a1cc2a0..83c1b37 100644 --- a/src/Lucene.Net.Core/Search/IndexSearcher.cs +++ b/src/Lucene.Net.Core/Search/IndexSearcher.cs @@ -3,6 +3,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; +using System.Threading; using System.Threading.Tasks; namespace Lucene.Net.Search @@ -892,11 +893,6 @@ namespace Lucene.Net.Search { } - /*public override bool HasNext() - { - return NumTasks > 0; - }*/ - public void Submit(ICallable<T> task) { this.service.Submit(task); @@ -908,30 +904,6 @@ namespace Lucene.Net.Search throw new NotSupportedException(); } - /*public override T Next() - { - if (!this.HasNext()) - { - throw new NoSuchElementException("next() is called but hasNext() returned false"); - } - try - { - return Service.Take().Get(); - } - catch (ThreadInterruptedException e) - { - throw new ThreadInterruptedException("Thread Interrupted Exception", e); - } - catch (ExecutionException e) - { - throw new Exception(e); - } - finally - { - --NumTasks; - } - }*/ - public bool MoveNext() { if (numTasks > 0) @@ -942,11 +914,12 @@ namespace Lucene.Net.Search awaitable.Wait(); current = awaitable.Result; + return true; } #if !NETSTANDARD - catch (System.Threading.ThreadInterruptedException e) + catch (ThreadInterruptedException e) { - throw new System.Threading.ThreadInterruptedException(e.ToString(), e); + throw new ThreadInterruptedException(e.ToString(), e); } #endif catch (Exception e) @@ -964,10 +937,11 @@ namespace Lucene.Net.Search return false; } - /*public override void Remove() - { - throw new System.NotSupportedException(); - }*/ + // LUCENENET NOTE: Not supported in .NET anyway + //public override void Remove() + //{ + // throw new System.NotSupportedException(); + //} public IEnumerator<T> GetEnumerator() {
