Swing and event dispatch thread checking
For swing components, when calling a method that should be called only from the event dispatch thread from some other thread, use assertions to indicate an error.
By default, system assertions are disabled which means all code (even the incorrect stuff) would run like normal, but turning them on would point out where any Swing event dispatch thread issues are through their stack traces.
Inside each checked method, the first line would be something like:
Thinking about annotations, it would be cool if each method that requires running on the event dispatch thread had an annotation like @eventDispatch which would automatically generate the above code through apt. This would also indicate to the user exactly which methods require running on the event dispatch thread and which can be run from other threads through the javadoc. The annotation would also be handy for other Swing component developers. But that might be a bit beyond apt's capabilities for the moment.