mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
reparse file on next EDT loop always to avoid potential locking in FileBasedIndexImpl (calling StorageGuard.enter#enter(true) and then StorageGuard.enter#enter(true) in stacktrace of the same thread leads to locking) (IDEA-CR-11333)
This commit is contained in:
@@ -70,7 +70,10 @@ public final class LanguageSubstitutors extends LanguageExtension<LanguageSubsti
|
||||
if (ApplicationManager.getApplication().isDispatchThread() && myReparsingInProgress) {
|
||||
return; // avoid recursive reparsing
|
||||
}
|
||||
invokeLaterIfNeeded(new Runnable() {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return;
|
||||
}
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LOG.info("Reparsing " + file.getPath() + " because of language substitution " +
|
||||
@@ -99,13 +102,4 @@ public final class LanguageSubstitutors extends LanguageExtension<LanguageSubsti
|
||||
}
|
||||
return lang;
|
||||
}
|
||||
|
||||
private static void invokeLaterIfNeeded(@NotNull Runnable runnable, @NotNull ModalityState modalityState) {
|
||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||
runnable.run();
|
||||
}
|
||||
else if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
ApplicationManager.getApplication().invokeLater(runnable, modalityState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user