NightOwl888 commented on code in PR #914:
URL: https://github.com/apache/lucenenet/pull/914#discussion_r1518650772


##########
src/Lucene.Net.Tests/Search/Spans/TestSpansAdvanced.cs:
##########
@@ -79,16 +82,9 @@ public override void SetUp()
         [TearDown]
         public override void TearDown()
         {
-            if (reader != null)
-            {
-                reader.Dispose();
-            }
-
-            if (mDirectory != null)
-            {
-                mDirectory.Dispose();
-                mDirectory = null;
-            }
+            reader.Dispose();

Review Comment:
   @paulirwin - Agreed. No need to start here. Tests are the lowest priority 
for adding nullable reference type checks. In J2N, these were not done at all 
in the tests (except those ported from Microsoft).
   
   I don't think it is worth it to make a concerted effort to do all of this 
work in one sweep due to the number of files this project has. However, when 
updating a piece of production code it may make sense to add it to the current 
file or even the current method for a given PR. Even if it just means marking 
the method signature nullable and using `#nullable restore` or a suppression 
inside of the method body to give the benefit to the end users. It would also 
be good to fill in the missing `ArgumentNullException`s so the runtime behavior 
matches what the compiler says to the outside world.
   
   Just chip away at it little by little until a concerted effort finally makes 
sense for a given project because it is mostly done.
   
   While there would eventually be issues where it may make sense to push fixes 
upstream, I don't think that would be very common. And when we upgrade the 
project, we can generally ignore these additions in most cases. We will be 
porting the delta of the changes between commits so we won't have to revisit 
these changes on each upgrade. They will just exist and we will only have to 
deal with them if there is a conflict of some kind. Lines we add may have 
issues to correct due to this feature, but that is par for the course of 
porting from Java.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to