This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit c3a53c31f5de1824f29c4543164f3f1e8766725f
Author: Shad Storhaug <[email protected]>
AuthorDate: Sat Aug 22 14:00:48 2020 +0700

    Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase: Fixed 
issue with reflection not finding the method due to the Func<string> parameter 
of Debugging.Assert()
---
 .../Support/JavaCompatibility/LuceneTestCase.cs                      | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/src/Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase.cs 
b/src/Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase.cs
index d2c7955..98f0f95 100644
--- a/src/Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Support/JavaCompatibility/LuceneTestCase.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Diagnostics;
 using Lucene.Net.Support;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using Assert = Lucene.Net.TestFramework.Assert;
 using JCG = J2N.Collections.Generic;
 
@@ -259,7 +260,9 @@ namespace Lucene.Net.Util
         [ExceptionToNetNumericConvention] // LUCENENET: This is for making 
test porting easier, keeping as-is
         internal int randomIntBetween(int min, int max)
         {
-            if (Debugging.AssertsEnabled) Debugging.Assert(max >= min, () => 
"max must be >= min: " + min + ", " + max);
+            // LUCENENET specific - added guard clause instead of assert
+            if (max < min)
+                throw new ArgumentOutOfRangeException(nameof(max), $"max must 
be >= min: {min}, {max}");
             long range = (long)max - (long)min;
             if (range < int.MaxValue)
             {

Reply via email to