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


##########
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:
   @NightOwl888 I'm assuming you're replying to @eladmarg since that comment 
was so close in time to mine. I think there's something to be said for having 
to suppress or add null-safe checks/propagation that doesn't exist in the Java 
code and how that could cause a significant deviation from the upstream Java 
code that doesn't have those checks/suppressions. I still think nullable 
reference types _one day_ could be beneficial to this project; and perhaps they 
could even find NPE bugs in the upstream Java code that we could contribute 
fixes back for. I don't think we need to start adding NRT checking in this 
small example, otherwise I've got many, many more that will just slow down 
getting this test review done, and this particular file is not a great example 
of it anyways. Perhaps I shouldn't have mentioned the topic 😄 



-- 
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