void (@NotNull ApplicationImpl app) { app.myLock = IdeEventQueue.getInstance().getRwLockHolder().lock; AtomicBoolean reported = new AtomicBoolean(); IdeEventQueue.getInstance().addPostprocessor(e -> { if (app.isWriteAccessAllowed() && reported.compareAndSet(false, true)) { getLogger().error("AWT events are not allowed inside write action: " + e); } return true; }, app.getCoroutineScope()); getThreadingSupport().setReadActionListener(app); getThreadingSupport().setWriteActionListener(app); app.addApplicationListener(new ApplicationListener() { @Override public void afterWriteActionFinished(@NotNull Object action) { reported.set(false); } }, app); }