mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
silence InterruptedException when closing project during indexing (IDEA-140662)
This commit is contained in:
@@ -414,7 +414,7 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica
|
||||
|
||||
@Nullable private Pair<DumbModeTask, ProgressIndicatorEx> getNextTask(@Nullable final DumbModeTask prevTask) {
|
||||
final Ref<Pair<DumbModeTask, ProgressIndicatorEx>> result = Ref.create();
|
||||
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
|
||||
invokeAndWaitIfNeeded(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (myProject.isDisposed()) return;
|
||||
@@ -443,6 +443,22 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica
|
||||
return result.get();
|
||||
}
|
||||
|
||||
private static void invokeAndWaitIfNeeded(Runnable runnable) {
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
runnable.run();
|
||||
}
|
||||
else {
|
||||
try {
|
||||
SwingUtilities.invokeAndWait(runnable);
|
||||
}
|
||||
catch (InterruptedException ignore) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getModificationCount() {
|
||||
return myModificationCount;
|
||||
|
||||
Reference in New Issue
Block a user