Skip to content

Commit 3b89de6

Browse files
committed
add read lock
1 parent 50871d3 commit 3b89de6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

java-execution-impl/src/main/java/com/intellij/java/execution/impl/jar/JarApplicationConfigurationProducer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.intellij.java.execution.impl.jar;
1717

1818
import consulo.annotation.component.ExtensionImpl;
19+
import consulo.application.ReadAction;
1920
import consulo.execution.action.ConfigurationContext;
2021
import consulo.execution.action.Location;
2122
import consulo.execution.action.RunConfigurationProducer;
@@ -40,7 +41,7 @@ protected boolean setupConfigurationFromContext(
4041
ConfigurationContext context,
4142
SimpleReference<PsiElement> sourceElement
4243
) {
43-
VirtualFile file = getJarFileFromContext(context);
44+
VirtualFile file = ReadAction.compute(() -> getJarFileFromContext(context));
4445
if (file != null) {
4546
configuration.setName(file.getName());
4647
configuration.setJarPath(file.getPath());
@@ -62,7 +63,7 @@ private static VirtualFile getJarFileFromContext(ConfigurationContext context) {
6263

6364
@Override
6465
public boolean isConfigurationFromContext(JarApplicationConfiguration configuration, ConfigurationContext context) {
65-
VirtualFile file = getJarFileFromContext(context);
66+
VirtualFile file = ReadAction.compute(() -> getJarFileFromContext(context));
6667
return file != null && FileUtil.pathsEqual(file.getPath(), configuration.getJarPath());
6768
}
6869
}

0 commit comments

Comments
 (0)