This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 178999
Collapse All | Expand All

(-)a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java (-6 / +23 lines)
Lines 1573-1578 Link Here
1573
            });
1574
            });
1574
        }
1575
        }
1575
1576
1577
        private static final RequestProcessor RP = new RequestProcessor("Recursive Listener Init", 1, true);
1576
        private boolean doIndex(
1578
        private boolean doIndex(
1577
                Collection<IndexableImpl> resources, // out-of-date (new/modified) files
1579
                Collection<IndexableImpl> resources, // out-of-date (new/modified) files
1578
                Collection<IndexableImpl> allResources, // all files
1580
                Collection<IndexableImpl> allResources, // all files
Lines 1582-1592 Link Here
1582
                SourceIndexers indexers,
1584
                SourceIndexers indexers,
1583
                Map<SourceIndexerFactory,Boolean> votes
1585
                Map<SourceIndexerFactory,Boolean> votes
1584
        ) throws IOException {
1586
        ) throws IOException {
1585
            if (getShuttdownRequest().isRaised()) {
1587
            class Interruptable implements Runnable {
1586
                //Do not call the expensive recursive listener if exiting
1588
                @Override
1587
                return false;
1589
                public void run() {
1588
            }
1590
                    RepositoryUpdater.getDefault().rootsListeners.add(root, true);
1589
            RepositoryUpdater.getDefault().rootsListeners.add(root, true);
1591
                }
1592
            }
1593
            RequestProcessor.Task task = RP.post(new Interruptable());
1594
            for (;;) {
1595
                if (task.isFinished()) {
1596
                    break;
1597
                }
1598
                try {
1599
                    task.waitFinished(1000);
1600
                    if (getShuttdownRequest().isRaised()) {
1601
                        //Do not call the expensive recursive listener if exiting
1602
                        return false;
1603
                    }
1604
                } catch (InterruptedException ex) {
1605
                    LOGGER.log(Level.INFO, "Interrupted", ex);
1606
                }
1607
            }
1590
1608
1591
            final LinkedList<Context> transactionContexts = new LinkedList<Context>();
1609
            final LinkedList<Context> transactionContexts = new LinkedList<Context>();
1592
            final LinkedList<Iterable<Indexable>> allIndexblesSentToIndexers = new LinkedList<Iterable<Indexable>>();
1610
            final LinkedList<Iterable<Indexable>> allIndexblesSentToIndexers = new LinkedList<Iterable<Indexable>>();
Lines 3211-3217 Link Here
3211
        
3229
        
3212
        private static void reportRootScan(URL root, long duration) {
3230
        private static void reportRootScan(URL root, long duration) {
3213
            try {
3231
            try {
3214
                Class c = Class.forName("org.netbeans.performance.test.utilities.LoggingScanClasspath",true,Thread.currentThread().getContextClassLoader()); // NOI18N
3232
                Class<?> c = Class.forName("org.netbeans.performance.test.utilities.LoggingScanClasspath",true,Thread.currentThread().getContextClassLoader()); // NOI18N
3215
                java.lang.reflect.Method m = c.getMethod("reportScanOfFile", new Class[] {String.class, Long.class}); // NOI18N
3233
                java.lang.reflect.Method m = c.getMethod("reportScanOfFile", new Class[] {String.class, Long.class}); // NOI18N
3216
                m.invoke(c.newInstance(), new Object[] {root.toExternalForm(), new Long(duration)});
3234
                m.invoke(c.newInstance(), new Object[] {root.toExternalForm(), new Long(duration)});
3217
            } catch (Exception e) {
3235
            } catch (Exception e) {
(-)a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/errors/Utilities.java (-1 lines)
Lines 39-45 Link Here
39
39
40
package org.netbeans.modules.parsing.impl.indexing.errors;
40
package org.netbeans.modules.parsing.impl.indexing.errors;
41
41
42
import com.sun.corba.se.spi.orbutil.threadpool.Work;
43
import java.io.IOException;
42
import java.io.IOException;
44
import java.util.LinkedList;
43
import java.util.LinkedList;
45
import java.util.List;
44
import java.util.List;

Return to bug 178999