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


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

Review Comment:
   this is for `MemoryIndex`



##########
ide/parsing.lucene/src/org/netbeans/modules/parsing/lucene/LuceneIndex.java:
##########
@@ -983,7 +957,7 @@ void refreshReader() throws IOException {
                     try {
                         synchronized (this) {
                             if (reader != null) {
-                                final IndexReader newReader = 
IndexReader.openIfChanged(reader);
+                                IndexReader newReader = 
IndexReader.openIfChanged(reader);
                                 if (newReader != null) {
                                     reader.close();
                                     reader = newReader;

Review Comment:
   both impls are now the same, this is `LuceneIndex`



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