private static void assertIsDispatchThread(String message) { if (ShutDownTracker.isShutdownHookRunning()) return; final Thread currentThread = Thread.currentThread(); if (ourDispatchThread == currentThread) return; if (EventQueue.isDispatchThread()) { ourDispatchThread = currentThread; } if (ourDispatchThread == currentThread) return; Integer safeCounter = ourEdtSafe.get(); if (safeCounter != null && safeCounter > 0) return; LOG.error( message, "Current thread: " + describe(Thread.currentThread()), "Our dispatch thread:" + describe(ourDispatchThread), "SystemEventQueueThread: " + describe(getEventQueueThread())); }
public void assertTimeConsuming() { if (myTestModeFlag || myHeadlessMode || ShutDownTracker.isShutdownHookRunning()) return; LOG.assertTrue( !isDispatchThread(), "This operation is time consuming and must not be called on EDT"); }