diff -r f214586d811e parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java --- a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java Tue Feb 09 12:46:47 2010 +0100 +++ b/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java Tue Feb 09 12:59:42 2010 +0100 @@ -1573,6 +1574,7 @@ }); } + private static final RequestProcessor RP = new RequestProcessor("Recursive Listener Init", 1, true); private boolean doIndex( Collection resources, // out-of-date (new/modified) files Collection allResources, // all files @@ -1582,11 +1584,27 @@ SourceIndexers indexers, Map votes ) throws IOException { - if (getShuttdownRequest().isRaised()) { - //Do not call the expensive recursive listener if exiting - return false; - } - RepositoryUpdater.getDefault().rootsListeners.add(root, true); + class Interruptable implements Runnable { + @Override + public void run() { + RepositoryUpdater.getDefault().rootsListeners.add(root, true); + } + } + RequestProcessor.Task task = RP.post(new Interruptable()); + for (;;) { + if (task.isFinished()) { + break; + } + try { + task.waitFinished(1000); + if (getShuttdownRequest().isRaised()) { + //Do not call the expensive recursive listener if exiting + return false; + } + } catch (InterruptedException ex) { + LOGGER.log(Level.INFO, "Interrupted", ex); + } + } final LinkedList transactionContexts = new LinkedList(); final LinkedList> allIndexblesSentToIndexers = new LinkedList>(); @@ -3211,7 +3229,7 @@ private static void reportRootScan(URL root, long duration) { try { - Class c = Class.forName("org.netbeans.performance.test.utilities.LoggingScanClasspath",true,Thread.currentThread().getContextClassLoader()); // NOI18N + Class c = Class.forName("org.netbeans.performance.test.utilities.LoggingScanClasspath",true,Thread.currentThread().getContextClassLoader()); // NOI18N java.lang.reflect.Method m = c.getMethod("reportScanOfFile", new Class[] {String.class, Long.class}); // NOI18N m.invoke(c.newInstance(), new Object[] {root.toExternalForm(), new Long(duration)}); } catch (Exception e) { diff -r f214586d811e parsing.api/src/org/netbeans/modules/parsing/impl/indexing/errors/Utilities.java --- a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/errors/Utilities.java Tue Feb 09 12:46:47 2010 +0100 +++ b/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/errors/Utilities.java Tue Feb 09 12:59:42 2010 +0100 @@ -39,7 +39,6 @@ package org.netbeans.modules.parsing.impl.indexing.errors; -import com.sun.corba.se.spi.orbutil.threadpool.Work; import java.io.IOException; import java.util.LinkedList; import java.util.List;