lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [20/50] [abbrv] lucenenet git commit: SWEEP: Eliminated FEATURE_THREADINTERRUPTEDEXCEPTION and fixed compilation symbols to allow ThreadInterruptException on .NET Standard 2.0
Date Sat, 09 Sep 2017 00:31:38 GMT
SWEEP: Eliminated FEATURE_THREADINTERRUPTEDEXCEPTION and fixed compilation symbols to allow
ThreadInterruptException on .NET Standard 2.0


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

Branch: refs/heads/master
Commit: afb2e0f316e71abf81ca168dd01e862524b82c91
Parents: 3284930
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Sep 6 23:11:39 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Sep 6 23:34:20 2017 +0700

----------------------------------------------------------------------
 .../Store/SlowOpeningMockIndexInputWrapper.cs   |  2 +-
 .../Lucene.Net.Tests.Benchmark.csproj           |  4 +--
 .../Lucene.Net.Tests.Facet.csproj               |  4 +--
 src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs  | 22 +++++++-------
 .../Index/TestDocumentsWriterDeleteQueue.cs     | 22 +++++++-------
 .../Index/TestDocumentsWriterStallControl.cs    |  6 ++--
 src/Lucene.Net.Tests/Index/TestIndexWriter.cs   | 20 ++++++++-----
 .../Index/TestIndexWriterNRTIsCurrent.cs        |  4 +--
 .../Index/TestIndexWriterReader.cs              | 22 +++++++-------
 .../Index/TestIndexWriterWithThreads.cs         | 22 +++++++-------
 .../Index/TestSnapshotDeletionPolicy.cs         | 22 +++++++-------
 .../TestControlledRealTimeReopenThread.cs       | 28 +++++++++---------
 .../Search/TestSearcherManager.cs               |  4 +--
 .../Search/TestTimeLimitingCollector.cs         | 30 +++++++++-----------
 src/Lucene.Net.Tests/Util/TestSetOnce.cs        |  2 +-
 .../Util/TestWeakIdentityMap.cs                 |  8 +++---
 .../Index/ConcurrentMergeScheduler.cs           | 28 +++++++++---------
 17 files changed, 125 insertions(+), 125 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs b/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs
index 6a9fcef..2a8c24a 100644
--- a/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs
@@ -45,7 +45,7 @@ namespace Lucene.Net.Store
                 catch (Exception)
                 {
                 }
-                throw new ThreadInterruptedException("Thread Interrupted Exception", ie);
+                throw new ThreadInterruptedException(ie.ToString(), ie);
             }
 #endif
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.csproj b/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.csproj
index 000f24d..af77062 100644
--- a/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.csproj
+++ b/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.csproj
@@ -62,8 +62,6 @@
   </ItemGroup>
   
   <PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
-    <!-- LUCENENET TODO: Change FEATURE_THREADINTERRUPTEDEXCEPTION to FEATURE_THREADINTERRUPT
and add solution wide -->
-    <DefineConstants>$(DefineConstants);FEATURE_THREAD_PRIORITY;FEATURE_THREADINTERRUPTEDEXCEPTION</DefineConstants>
     <DebugType>portable</DebugType>
   </PropertyGroup>
 
@@ -77,7 +75,7 @@
   </PropertyGroup>
 
   <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' ">
-    <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS;FEATURE_THREAD_PRIORITY;FEATURE_THREADINTERRUPTEDEXCEPTION</DefineConstants>
+    <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants>
     <DebugType>full</DebugType>
   </PropertyGroup>
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests.Facet/Lucene.Net.Tests.Facet.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Lucene.Net.Tests.Facet.csproj b/src/Lucene.Net.Tests.Facet/Lucene.Net.Tests.Facet.csproj
index 8382701..4087699 100644
--- a/src/Lucene.Net.Tests.Facet/Lucene.Net.Tests.Facet.csproj
+++ b/src/Lucene.Net.Tests.Facet/Lucene.Net.Tests.Facet.csproj
@@ -58,7 +58,7 @@
   </ItemGroup>
 
   <PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
-    <DefineConstants>$(DefineConstants);FEATURE_THREAD_PRIORITY;FEATURE_THREADINTERRUPTEDEXCEPTION</DefineConstants>
+    <DefineConstants>$(DefineConstants);FEATURE_THREAD_PRIORITY</DefineConstants>
     <DebugType>portable</DebugType>
   </PropertyGroup>
 
@@ -68,7 +68,7 @@
   </PropertyGroup>
 
   <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' ">
-    <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS;FEATURE_THREAD_PRIORITY;FEATURE_THREADINTERRUPTEDEXCEPTION</DefineConstants>
+    <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS;FEATURE_THREAD_PRIORITY</DefineConstants>
     <DebugType>full</DebugType>
   </PropertyGroup>
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs b/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs
index 782d376..4cff489 100644
--- a/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs
+++ b/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs
@@ -80,18 +80,18 @@ namespace Lucene.Net.Facet
             {
                 sTime = random.Next(sTime);
             }
-#if FEATURE_THREADINTERRUPTEDEXCEPTION
-            try
-            {
-#endif
+//#if !NETSTANDARD1_5
+//            try
+//            {
+//#endif
                 Thread.Sleep(sTime);
-#if FEATURE_THREADINTERRUPTEDEXCEPTION
-            }
-            catch (ThreadInterruptedException e)
-            {
-                throw new ThreadInterruptedException("Thread Interrupted Exception", e);
-            }
-#endif
+//#if !NETSTANDARD1_5
+//            }
+//            catch (ThreadInterruptedException e) // LUCENENET NOTE: Senseless to catch
and rethrow the same exception type
+//            {
+//                throw new ThreadInterruptedException("Thread Interrupted Exception", e);
+//            }
+//#endif
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Index/TestDocumentsWriterDeleteQueue.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestDocumentsWriterDeleteQueue.cs b/src/Lucene.Net.Tests/Index/TestDocumentsWriterDeleteQueue.cs
index b027098..2eae0bd 100644
--- a/src/Lucene.Net.Tests/Index/TestDocumentsWriterDeleteQueue.cs
+++ b/src/Lucene.Net.Tests/Index/TestDocumentsWriterDeleteQueue.cs
@@ -276,18 +276,18 @@ namespace Lucene.Net.Index
 
             public override void Run()
             {
-#if !NETSTANDARD
-                try
-                {
-#endif
+//#if !NETSTANDARD1_5
+//                try
+//                {
+//#endif
                     Latch.Wait();
-#if !NETSTANDARD
-                }
-                catch (ThreadInterruptedException e)
-                {
-                    throw new ThreadInterruptedException("Thread Interrupted Exception",
e);
-                }
-#endif
+//#if !NETSTANDARD1_5
+//                }
+//                catch (ThreadInterruptedException e) // LUCENENET NOTE: Senseless to catch
and rethrow the same exception type
+//                {
+//                    throw new ThreadInterruptedException("Thread Interrupted Exception",
e);
+//                }
+//#endif
 
                 int i = 0;
                 while ((i = Index.GetAndIncrement()) < Ids.Length)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Index/TestDocumentsWriterStallControl.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestDocumentsWriterStallControl.cs b/src/Lucene.Net.Tests/Index/TestDocumentsWriterStallControl.cs
index 923d9b5..a5b948d 100644
--- a/src/Lucene.Net.Tests/Index/TestDocumentsWriterStallControl.cs
+++ b/src/Lucene.Net.Tests/Index/TestDocumentsWriterStallControl.cs
@@ -263,12 +263,12 @@ namespace Lucene.Net.Index
                         Ctrl.WaitIfStalled();
                         if (CheckPoint.Get())
                         {
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                             try
                             {
 #endif
                                 Assert.IsTrue(Sync.await());
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                             }
                             catch (ThreadInterruptedException e)
                             {
@@ -326,7 +326,7 @@ namespace Lucene.Net.Index
                             {
                                 Assert.IsTrue(Sync.await());
                             }
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                             catch (ThreadInterruptedException e)
                             {
                                 Console.WriteLine("[Updater] got interrupted - wait count:
" + Sync.Waiter.CurrentCount);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriter.cs b/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
index 827be36..d8145e8 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriter.cs
@@ -1308,7 +1308,7 @@ namespace Lucene.Net.Index
                             AllowInterrupt = true;
                         }
                     }
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                     catch (ThreadInterruptedException re)
                     {
                         // NOTE: important to leave this verbosity/noise
@@ -1316,9 +1316,15 @@ namespace Lucene.Net.Index
                         // Jenkins hits a fail we need to study where the
                         // interrupts struck!
                         Console.WriteLine("TEST: got interrupt");
-                        Console.WriteLine(re.StackTrace);
-                        Exception e = re.InnerException;
-                        Assert.IsTrue(e is ThreadInterruptedException);
+                        Console.WriteLine(re.ToString());
+
+                        // LUCENENET NOTE: Since our original exception is ThreadInterruptException
instead of InterruptException
+                        // in .NET, our expectation is typically that the InnerException
is null (but it doesn't have to be).
+                        // So, this assertion is not needed in .NET. And if we get to this
catch block, we already know we have
+                        // the right exception type, so there is nothing to test here. Besides,
this throws an assertion that would
+                        // crash the test framework anyway.
+                        //Exception e = re.InnerException;
+                        //Assert.IsTrue(e is ThreadInterruptedException);
                         if (Finish)
                         {
                             break;
@@ -1328,7 +1334,7 @@ namespace Lucene.Net.Index
                     catch (Exception t)
                     {
                         Console.WriteLine("FAILED; unexpected exception");
-                        Console.WriteLine(t.StackTrace);
+                        Console.WriteLine(t.ToString());
                         Failed = true;
                         break;
                     }
@@ -1362,7 +1368,7 @@ namespace Lucene.Net.Index
                     {
                         Failed = true;
                         Console.WriteLine("CheckIndex FAILED: unexpected exception");
-                        Console.WriteLine(e.StackTrace);
+                        Console.WriteLine(e.ToString());
                     }
                     try
                     {
@@ -1374,7 +1380,7 @@ namespace Lucene.Net.Index
                     {
                         Failed = true;
                         Console.WriteLine("DirectoryReader.open FAILED: unexpected exception");
-                        Console.WriteLine(e.StackTrace);
+                        Console.WriteLine(e.ToString());
                     }
                 }
                 try

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Index/TestIndexWriterNRTIsCurrent.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterNRTIsCurrent.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterNRTIsCurrent.cs
index 50a1ade..0497f21 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterNRTIsCurrent.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterNRTIsCurrent.cs
@@ -200,12 +200,12 @@ namespace Lucene.Net.Index
 
             public override void Run()
             {
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 try
                 {
 #endif
                     Latch.Wait();
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 }
                 catch (ThreadInterruptedException e)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
index 8bfa64e..c596d87 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
@@ -510,18 +510,18 @@ namespace Lucene.Net.Index
             {
                 for (int i = 0; i < OuterInstance.NumThreads; i++)
                 {
-#if !NETSTANDARD
-                    try
-                    {
-#endif
+//#if !NETSTANDARD1_5
+//                    try
+//                    {
+//#endif
                     Threads[i].Join();
-#if !NETSTANDARD
-                    }
-                    catch (ThreadInterruptedException ie)
-                    {
-                        throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
-                    }
-#endif
+//#if !NETSTANDARD1_5
+//                    }
+//                    catch (ThreadInterruptedException ie) // LUCENENET NOTE: Senseless
to catch and rethrow the same exception type
+//                    {
+//                        throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
+//                    }
+//#endif
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs
index 8b488d7..a158ecd 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs
@@ -112,18 +112,18 @@ namespace Lucene.Net.Index
                         if (ioe.Message.StartsWith("fake disk full at", StringComparison.Ordinal)
|| ioe.Message.Equals("now failing on purpose", StringComparison.Ordinal))
                         {
                             DiskFull = true;
-#if !NETSTANDARD
-                            try
-                            {
-#endif
+//#if !NETSTANDARD1_5
+//                            try
+//                            {
+//#endif
                                 Thread.Sleep(1);
-#if !NETSTANDARD
-                            }
-                            catch (ThreadInterruptedException ie)
-                            {
-                                throw new ThreadInterruptedException(ie.toString(), ie);
-                            }
-#endif
+//#if !NETSTANDARD1_5
+//                            }
+//                            catch (ThreadInterruptedException ie) // LUCENENET NOTE: Senseless
to catch and rethrow the same exception type
+//                            {
+//                                throw new ThreadInterruptedException(ie.toString(), ie);
+//                            }
+//#endif
                             if (fullCount++ >= 5)
                             {
                                 break;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Index/TestSnapshotDeletionPolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestSnapshotDeletionPolicy.cs b/src/Lucene.Net.Tests/Index/TestSnapshotDeletionPolicy.cs
index 6fb3f7f..8813d84 100644
--- a/src/Lucene.Net.Tests/Index/TestSnapshotDeletionPolicy.cs
+++ b/src/Lucene.Net.Tests/Index/TestSnapshotDeletionPolicy.cs
@@ -232,18 +232,18 @@ namespace Lucene.Net.Index
                             }
                         }
                     }
-#if !NETSTANDARD
-                    try
-                    {
-#endif 
+//#if !NETSTANDARD1_5
+//                    try
+//                    {
+//#endif 
                         Thread.Sleep(1);
-#if !NETSTANDARD
-                    }
-                    catch (ThreadInterruptedException ie)
-                    {
-                        throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
-                    }
-#endif
+//#if !NETSTANDARD1_5
+//                    }
+//                    catch (ThreadInterruptedException ie) // LUCENENET NOTE: Senseless
to catch and rethrow the same exception type
+//                    {
+//                        throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
+//                    }
+//#endif
                 } while (Environment.TickCount < StopTime);
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs b/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs
index 96c8be9..0a75c29 100644
--- a/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs
+++ b/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs
@@ -495,12 +495,12 @@ namespace Lucene.Net.Search
 
             public override void Run()
             {
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 try
                 {
 #endif
                     thread.WaitForGeneration(lastGen);
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 }
                 catch (ThreadInterruptedException ie)
                 {
@@ -530,24 +530,22 @@ namespace Lucene.Net.Search
             public override void UpdateDocument(Term term, IEnumerable<IIndexableField>
doc, Analyzer analyzer)
             {
                 base.UpdateDocument(term, doc, analyzer);
-#if !NETSTANDARD
-                try
-                {
-#endif
+//#if !NETSTANDARD1_5
+//                try
+//                {
+//#endif
                     if (waitAfterUpdate)
                     {
                         signal.Reset(signal.CurrentCount == 0 ? 0 : signal.CurrentCount -
1);
                         latch.Wait();
                     }
-#if !NETSTANDARD
-                }
-#pragma warning disable 168
-                catch (ThreadInterruptedException e)
-#pragma warning restore 168
-                {
-                    throw;
-                }
-#endif
+//#if !NETSTANDARD1_5
+//                }
+//                catch (ThreadInterruptedException) // LUCENENET NOTE: Senseless to catch
and rethrow the same exception type
+//                {
+//                    throw;
+//                }
+//#endif
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Search/TestSearcherManager.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/TestSearcherManager.cs b/src/Lucene.Net.Tests/Search/TestSearcherManager.cs
index 95d9c20..833ebcb 100644
--- a/src/Lucene.Net.Tests/Search/TestSearcherManager.cs
+++ b/src/Lucene.Net.Tests/Search/TestSearcherManager.cs
@@ -356,7 +356,7 @@ namespace Lucene.Net.Search
 
             public override IndexSearcher NewSearcher(IndexReader r)
             {
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 try
                 {
 #endif
@@ -365,7 +365,7 @@ namespace Lucene.Net.Search
                         awaitEnterWarm.Signal();
                         awaitClose.Wait();
                     }
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 }
 #pragma warning disable 168
                 catch (ThreadInterruptedException e)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs b/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs
index c2ca5dd..d9f36ad 100644
--- a/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs
+++ b/src/Lucene.Net.Tests/Search/TestTimeLimitingCollector.cs
@@ -404,23 +404,21 @@ namespace Lucene.Net.Search
                 int docId = doc + docBase;
                 if (slowdown > 0)
                 {
-                    try
-                    {
+                    //try
+                    //{
                         ThreadClass.Sleep(slowdown);
-                    }
-#if NETSTANDARD
-                    catch (Exception)
-                    {
-                        throw;
-                    }
-#else
-#pragma warning disable 168
-                    catch (ThreadInterruptedException ie)
-#pragma warning restore 168
-                    {
-                        throw;
-                    }
-#endif
+//                    }
+//#if NETSTANDARD1_5
+//                    catch (Exception)
+//                    {
+//                        throw;
+//                    }
+//#else
+//                    catch (ThreadInterruptedException) // LUCENENET NOTE: Senseless to
catch and rethrow the same exception type
+//                    {
+//                        throw;
+//                    }
+//#endif
                 }
                 Debug.Assert(docId >= 0, " base=" + docBase + " doc=" + doc);
                 bits.Set(docId);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Util/TestSetOnce.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Util/TestSetOnce.cs b/src/Lucene.Net.Tests/Util/TestSetOnce.cs
index 22deb08..5473e45 100644
--- a/src/Lucene.Net.Tests/Util/TestSetOnce.cs
+++ b/src/Lucene.Net.Tests/Util/TestSetOnce.cs
@@ -55,7 +55,7 @@ namespace Lucene.Net.Util
                     set.Set(new Integer(Convert.ToInt32(Name.Substring(2), CultureInfo.InvariantCulture)));
                     success = true;
                 }
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 catch (ThreadInterruptedException)
                 {
                     // ignore

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs b/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs
index 9c0286a..57e5419 100644
--- a/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs
+++ b/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs
@@ -136,7 +136,7 @@ namespace Lucene.Net.Util
             int size = map.Count;
             for (int i = 0; size > 0 && i < 10; i++)
             {
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 try
                 {
 #endif
@@ -155,7 +155,7 @@ namespace Lucene.Net.Util
                     Assert.IsTrue(size >= c, "previousSize(" + size + ")>=iteratorSize("
+ c + ")");
                     Assert.IsTrue(c >= newSize, "iteratorSize(" + c + ")>=newSize("
+ newSize + ")");
                     size = newSize;
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 }
 #pragma warning disable 168
                 catch (ThreadInterruptedException ie)
@@ -255,7 +255,7 @@ namespace Lucene.Net.Util
             int size = map.Count;
             for (int i = 0; size > 0 && i < 10; i++)
             {
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 try
                 {
 #endif
@@ -274,7 +274,7 @@ namespace Lucene.Net.Util
                     Assert.IsTrue(size >= c, "previousSize(" + size + ")>=iteratorSize("
+ c + ")");
                     Assert.IsTrue(c >= newSize, "iteratorSize(" + c + ")>=newSize("
+ newSize + ")");
                     size = newSize;
-#if !NETSTANDARD
+#if !NETSTANDARD1_5
                 }
 #pragma warning disable 168
                 catch (ThreadInterruptedException ie)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/afb2e0f3/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs b/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
index d03e891..12b4340 100644
--- a/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
+++ b/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
@@ -457,14 +457,14 @@ namespace Lucene.Net.Index
                         {
                             Message("    too many merges; stalling...");
                         }
-                        try
-                        {
+                        //try
+                        //{
                             Monitor.Wait(this);
-                        }
-                        catch (ThreadInterruptedException ie)
-                        {
-                            throw new ThreadInterruptedException(ie.ToString(), ie);
-                        }
+                        //}
+                        //catch (ThreadInterruptedException ie) // LUCENENET NOTE: Senseless
to catch and rethrow the same exception type
+                        //{
+                        //    throw new ThreadInterruptedException(ie.ToString(), ie);
+                        //}
                     }
 
                     if (IsVerbose)
@@ -715,8 +715,8 @@ namespace Lucene.Net.Index
         /// </summary>
         protected virtual void HandleMergeException(Exception exc)
         {
-            try
-            {
+            //try
+            //{
                 // When an exception is hit during merge, IndexWriter
                 // removes any partial files and then allows another
                 // merge to run.  If whatever caused the error is not
@@ -724,11 +724,11 @@ namespace Lucene.Net.Index
                 // so, we sleep here to avoid saturating CPU in such
                 // cases:
                 Thread.Sleep(250);
-            }
-            catch (ThreadInterruptedException ie)
-            {
-                throw new ThreadInterruptedException("Thread Interrupted Exception", ie);
-            }
+            //}
+            //catch (ThreadInterruptedException ie) // LUCENENET NOTE: Senseless to catch
and rethrow the same exception type
+            //{
+            //    throw new ThreadInterruptedException("Thread Interrupted Exception", ie);
+            //}
             throw new MergePolicy.MergeException(exc, m_dir);
         }
 


Mime
View raw message