more reliable GDSL script execution

This commit is contained in:
peter.gromov
2010-11-08 17:57:34 +03:00
parent 1fec75c35a
commit 87b635ba86
@@ -237,9 +237,8 @@ public class GroovyDslFileIndex extends ScalarIndexExtension<String> {
final long stamp = vfile.getModificationStamp();
final GroovyDslExecutor cached = getCachedExecutor(vfile, stamp);
if (cached == null) {
if (scheduleParsing(queue, project, vfile, stamp, psiFile.getText())) {
count++;
}
scheduleParsing(queue, project, vfile, stamp, psiFile.getText());
count++;
}
else {
result.add(new GroovyDslScript(project, vfile, cached));
@@ -281,7 +280,7 @@ public class GroovyDslFileIndex extends ScalarIndexExtension<String> {
}
}
private static boolean scheduleParsing(final LinkedBlockingQueue<Pair<VirtualFile, GroovyDslExecutor>> queue,
private static void scheduleParsing(final LinkedBlockingQueue<Pair<VirtualFile, GroovyDslExecutor>> queue,
final Project project,
final VirtualFile vfile,
final long stamp,
@@ -319,10 +318,8 @@ public class GroovyDslFileIndex extends ScalarIndexExtension<String> {
if (isNewRequest) {
ourPool.execute(parseScript); //todo bring back multithreading when Groovy team fixes http://jira.codehaus.org/browse/GROOVY-4292
//ApplicationManager.getApplication().executeOnPooledThread(parseScript);
return true;
}
}
return false;
}
private static volatile boolean stopGdsl = false;