From 4e1dcc941a65f313bf7128eb4592d92bf2bf3468 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Fri, 24 May 2024 10:11:54 +0700 Subject: [PATCH] Lucene.Net.Support.Threading.ReentrantLockTest::TestUnlock_IllegalMonitorStateException() Removed unused exception variable and added a comment to indicate success so we don't have to suppress warnings --- .../Support/Threading/ReentrantLockTest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Lucene.Net.Tests/Support/Threading/ReentrantLockTest.cs b/src/Lucene.Net.Tests/Support/Threading/ReentrantLockTest.cs index 0d1b15dfa0..21bc3f56fc 100644 --- a/src/Lucene.Net.Tests/Support/Threading/ReentrantLockTest.cs +++ b/src/Lucene.Net.Tests/Support/Threading/ReentrantLockTest.cs @@ -166,9 +166,10 @@ public void TestUnlock_IllegalMonitorStateException() rl.Unlock(); shouldThrow(); } -#pragma warning disable CS0168 // Variable is declared but never used - catch (SynchronizationLockException success) { } -#pragma warning restore CS0168 // Variable is declared but never used + catch (SynchronizationLockException) + { + // success + } } ///**