jpountz commented on code in PR #11954:
URL: https://github.com/apache/lucene/pull/11954#discussion_r1029194303


##########
lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java:
##########
@@ -784,7 +770,10 @@ protected DirectoryReader 
doWrapDirectoryReader(DirectoryReader in) throws IOExc
    */
   public static DirectoryReader wrap(DirectoryReader in, QueryTimeout 
queryTimeout)
       throws IOException {
-    return new ExitableDirectoryReader(in, queryTimeout);
+    if (queryTimeout != null) {

Review Comment:
   I don't think it's worth accepting `null` query timeouts. Let's reject 
`null` queryTimeout objects entirely?



##########
lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java:
##########
@@ -292,7 +296,11 @@ public void testExitablePointValuesIndexReader() throws 
Exception {
     // Not checking the validity of the result, all we are bothered about in 
this test is the timing
     // out.
     directoryReader = DirectoryReader.open(directory);
-    exitableDirectoryReader = new ExitableDirectoryReader(directoryReader, 
disabledQueryTimeout());
+    exitableDirectoryReader = directoryReader;
+    if (disabledQueryTimeout() != null) {

Review Comment:
   It is always null so we should be able to remove this code path?



-- 
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: issues-unsubscr...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to