matthiasblaesing commented on code in PR #8590:
URL: https://github.com/apache/netbeans/pull/8590#discussion_r2160122388


##########
ide/parsing.lucene/src/org/netbeans/modules/parsing/lucene/MemoryIndex.java:
##########
@@ -304,7 +290,7 @@ private synchronized IndexReader getReader() throws 
IOException {
     private synchronized void refreshReader() throws IOException {
         assert lock.isWriteLockedByCurrentThread();
         if (cachedReader != null) {
-            final IndexReader newReader = cachedReader.reopen();
+            IndexReader newReader = IndexReader.openIfChanged(cachedReader);

Review Comment:
   According to my reading of the documentation this is not correct. The two 
functions have different semantics:
   
    `openIfChanged` says:
   
   > Returns:
   >   null if there are no changes; else, a new IndexReader instance which you 
must eventually close 
   
   While `reopen` says:
   
   >  If the index has not changed since this instance was (re)opened, then 
this call is a NOOP and returns this instance. Otherwise, a new instance is 
returned. The old instance is not closed and remains usable.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to