From 3104e292641fdff576be521ff1b33d0d3eb7470d Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 11 Feb 2013 23:05:06 +0100 Subject: [PATCH] initialize gdsl extensions on a thread which probably has a read action already, but don't mess with classloading --- .../org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java index 2dc273d250a0..81c831d3b2cf 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java @@ -83,7 +83,6 @@ public class GroovyDslFileIndex extends ScalarIndexExtension { public static final String MODIFIED = "Modified"; public static final NotificationGroup NOTIFICATION_GROUP = new NotificationGroup("Groovy DSL errors", NotificationDisplayType.BALLOON, true); - private static final GroovyFrameworkConfigNotification[] EXTENSIONS = GroovyFrameworkConfigNotification.EP_NAME.getExtensions(); private final MyDataIndexer myDataIndexer = new MyDataIndexer(); private final MyInputFilter myInputFilter = new MyInputFilter(); @@ -284,6 +283,8 @@ public class GroovyDslFileIndex extends ScalarIndexExtension { return result; } + final GroovyFrameworkConfigNotification[] extensions = GroovyFrameworkConfigNotification.EP_NAME.getExtensions(); + final Semaphore semaphore = new Semaphore(); semaphore.down(); final AtomicReference>> ref = new AtomicReference>>(); @@ -300,7 +301,7 @@ public class GroovyDslFileIndex extends ScalarIndexExtension { Set scriptFolders = new LinkedHashSet(); // perhaps a separate extension for that? - for (GroovyFrameworkConfigNotification extension : EXTENSIONS) { + for (GroovyFrameworkConfigNotification extension : extensions) { File jarPath = new File(PathUtil.getJarPathForClass(extension.getClass())); if (jarPath.isFile()) { jarPath = jarPath.getParentFile();