mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
allow waitForSmartMode invocations on EDT
This commit is contained in:
@@ -281,18 +281,15 @@ public class DumbServiceImpl extends DumbService implements Disposable {
|
||||
|
||||
@Override
|
||||
public void waitForSmartMode() {
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
if (!application.isUnitTestMode()) {
|
||||
assert !application.isDispatchThread();
|
||||
if (application.isReadAccessAllowed() && isDumb()) {
|
||||
throw new AssertionError("Don't invoke waitForSmartMode from inside read action in dumb mode");
|
||||
}
|
||||
}
|
||||
|
||||
if (!isDumb()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
if (application.isReadAccessAllowed() || application.isDispatchThread()) {
|
||||
throw new AssertionError("Don't invoke waitForSmartMode from inside read action in dumb mode");
|
||||
}
|
||||
|
||||
final Semaphore semaphore = new Semaphore();
|
||||
semaphore.down();
|
||||
runWhenSmart(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user