[hg] main-silver: #223206:Tasks calling QuerySupport Index.Index...

  • From: Tomas Zezula < >
  • To:
  • Subject: [hg] main-silver: #223206:Tasks calling QuerySupport Index.Index...
  • Date: Mon, 03 Dec 2012 16:38:25 -0800

changeset 0085ca71c51e in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/0085ca71c51e
description:
        #223206:Tasks calling QuerySupport Index.IndexClosedException get 
Index.IndexClosedException

diffstat:

 parsing.api/src/org/netbeans/modules/parsing/impl/Installer.java             
       |  7 +++++++
 
parsing.api/src/org/netbeans/modules/parsing/spi/indexing/support/QuerySupport.java
 |  8 ++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diffs (56 lines):

diff --git a/parsing.api/src/org/netbeans/modules/parsing/impl/Installer.java 
b/parsing.api/src/org/netbeans/modules/parsing/impl/Installer.java
--- a/parsing.api/src/org/netbeans/modules/parsing/impl/Installer.java
+++ b/parsing.api/src/org/netbeans/modules/parsing/impl/Installer.java
@@ -56,6 +56,12 @@
  */
 public class Installer extends ModuleInstall {
 
+    private static volatile boolean closed;
+
+    public static boolean isClosed() {
+        return closed;
+    }
+
     @Override
     public void restored () {
         super.restored();
@@ -77,6 +83,7 @@
     @Override
     public void close() {
         super.close();
+        closed = true;
         final CountDownLatch done = new CountDownLatch(1);
         final Runnable postTask = new Runnable() {
             private AtomicBoolean started = new AtomicBoolean();
diff --git 
a/parsing.api/src/org/netbeans/modules/parsing/spi/indexing/support/QuerySupport.java
 
b/parsing.api/src/org/netbeans/modules/parsing/spi/indexing/support/QuerySupport.java
--- 
a/parsing.api/src/org/netbeans/modules/parsing/spi/indexing/support/QuerySupport.java
+++ 
b/parsing.api/src/org/netbeans/modules/parsing/spi/indexing/support/QuerySupport.java
@@ -63,6 +63,7 @@
 import org.netbeans.api.java.classpath.ClassPath;
 import org.netbeans.api.project.FileOwnerQuery;
 import org.netbeans.api.project.Project;
+import org.netbeans.modules.parsing.impl.Installer;
 import org.netbeans.modules.parsing.impl.RunWhenScanFinishedSupport;
 import org.netbeans.modules.parsing.impl.Utilities;
 import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
@@ -78,6 +79,7 @@
 import 
org.netbeans.modules.parsing.impl.indexing.lucene.LayeredDocumentIndex;
 import org.netbeans.modules.parsing.impl.indexing.lucene.LuceneIndexFactory;
 import org.netbeans.modules.parsing.lucene.support.DocumentIndex;
+import org.netbeans.modules.parsing.lucene.support.Index;
 import org.netbeans.modules.parsing.lucene.support.Queries;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileStateInvalidException;
@@ -310,6 +312,12 @@
                     return result;
                 }
             });
+        } catch (Index.IndexClosedException ice) {
+            if (Installer.isClosed()) {
+                return Collections.<IndexResult>emptySet();
+            } else {
+                throw ice;
+            }
         } catch (IOException ioe) {
             throw ioe;
         } catch (RuntimeException re) {

[hg] main-silver: #223206:Tasks calling QuerySupport Index.Index...

Tomas Zezula 12/04/2012

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close