I am tired of runWriteAction and so on. IDEA should provide these annotations, which have the following effects:
@InReadAction adds ApplicationManager.getApplication().runReadAction(new Runnable() { public void run() { to the beginning of the method, and } })); to the end.
@OnEventQueue(when=NOW|LATER) adds Application app = ApplicationManager.getApplication(); Runnable me = new Runnable() { public void run() { to the beginning of the method, and {{ }}; if (app.isDispatchThread()) { me.run(); } else { app.invoke${which}(me); } }} to the end, where {{${which} }} is Later or AndWait depending on the value of when argument to the annotation.
@InWriteAction(when=NOW|LATER) is very similar to @OnEventQueue except it runs the runnable wrapped in app.runWriteAction() as well.
I currently use runReadAction 14 times in my plugins. I use runWriteAction 33 times. I use invokeLater and invokeAndWait 10 times. Hopefully with these annotations I could eliminate all of those calls and all of that boilerplate.
By the way, maybe you could take the fact that this bug report is pretty hard to read, as a sign that the currently required boilerplate makes code similarly unreadable.