mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove unused code from LaterInvocator
This commit is contained in:
+10
-23
@@ -53,7 +53,6 @@ public class LaterInvocator {
|
||||
private static final boolean DEBUG = LOG.isDebugEnabled();
|
||||
|
||||
private static final Object LOCK = new Object();
|
||||
private static final IdeEventQueue ourEventQueue = IdeEventQueue.getInstance();
|
||||
|
||||
private LaterInvocator() { }
|
||||
|
||||
@@ -92,8 +91,6 @@ public class LaterInvocator {
|
||||
private static volatile int ourQueueSkipCount; // optimization
|
||||
private static final FlushQueue ourFlushQueueRunnable = new FlushQueue();
|
||||
|
||||
private static final Stack<AWTEvent> ourEventStack = new Stack<>(); // guarded by RUN_LOCK
|
||||
|
||||
private static final EventDispatcher<ModalityStateListener> ourModalityStateMulticaster = EventDispatcher.create(ModalityStateListener.class);
|
||||
|
||||
public static void addModalityStateListener(@NotNull ModalityStateListener listener, @NotNull Disposable parentDisposable) {
|
||||
@@ -390,7 +387,6 @@ public class LaterInvocator {
|
||||
}
|
||||
|
||||
private static final AtomicBoolean FLUSHER_SCHEDULED = new AtomicBoolean(false);
|
||||
private static final Object RUN_LOCK = new Object();
|
||||
|
||||
private static class FlushQueue implements Runnable {
|
||||
@SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized") private RunnableInfo myLastInfo;
|
||||
@@ -408,25 +404,16 @@ public class LaterInvocator {
|
||||
myLastInfo = lastInfo;
|
||||
|
||||
if (lastInfo != null) {
|
||||
synchronized (RUN_LOCK) { // necessary only because of switching to our own event queue
|
||||
AWTEvent event = ourEventQueue.getTrueCurrentEvent();
|
||||
ourEventStack.push(event);
|
||||
int stackSize = ourEventStack.size();
|
||||
|
||||
try {
|
||||
lastInfo.runnable.run();
|
||||
lastInfo.callback.setDone();
|
||||
}
|
||||
catch (ProcessCanceledException ignored) { }
|
||||
catch (Throwable t) {
|
||||
LOG.error(t);
|
||||
}
|
||||
finally {
|
||||
LOG.assertTrue(ourEventStack.size() == stackSize);
|
||||
ourEventStack.pop();
|
||||
|
||||
if (!DEBUG) myLastInfo = null;
|
||||
}
|
||||
try {
|
||||
lastInfo.runnable.run();
|
||||
lastInfo.callback.setDone();
|
||||
}
|
||||
catch (ProcessCanceledException ignored) { }
|
||||
catch (Throwable t) {
|
||||
LOG.error(t);
|
||||
}
|
||||
finally {
|
||||
if (!DEBUG) myLastInfo = null;
|
||||
}
|
||||
}
|
||||
return lastInfo != null;
|
||||
|
||||
Reference in New Issue
Block a user