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

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


The following commit(s) were added to refs/heads/master by this push:
     new 47adc07d0 Simplify IndexReader constructor, #919 (#1081)
47adc07d0 is described below

commit 47adc07d0e21cdc8f7548c9517b12d69e5521054
Author: Paul Irwin <[email protected]>
AuthorDate: Tue Dec 31 17:28:22 2024 -0700

    Simplify IndexReader constructor, #919 (#1081)
---
 src/Lucene.Net/Index/IndexReader.cs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/Lucene.Net/Index/IndexReader.cs 
b/src/Lucene.Net/Index/IndexReader.cs
index 518cbde04..429a12458 100644
--- a/src/Lucene.Net/Index/IndexReader.cs
+++ b/src/Lucene.Net/Index/IndexReader.cs
@@ -85,10 +85,11 @@ namespace Lucene.Net.Index
 
         private protected IndexReader() // LUCENENET: Changed from internal to 
private protected
         {
-            if (!(this is CompositeReader || this is AtomicReader))
-            {
-                throw Error.Create("IndexReader should never be directly 
extended, subclass AtomicReader or CompositeReader instead.");
-            }
+            // LUCENENET NOTE: this is enforced by the compiler in .NET due to 
`private protected`, so we don't need to check it here.
+            // if (!(this is CompositeReader || this is AtomicReader))
+            // {
+            //     throw Error.Create("IndexReader should never be directly 
extended, subclass AtomicReader or CompositeReader instead.");
+            // }
         }
 
 #if !FEATURE_CONDITIONALWEAKTABLE_ENUMERATOR

Reply via email to