I am looking for an automatic way to detect violations of the Swing's single threaded policy in my code. I'm looking for something along the lines of some AOP code you drop into the VM while the swing app is running and have it log any places where a swing component is modified outside of the EDT.
I'm not an AOP guy but I would imagine creating an AOP proxy around every java.swing.* class which looks like
AOP_before(Method m, Object args[]) {
if (!isEventDispatchThread(Thread.currentThread()) {
logStack(new RuntimeException("violation!"));
}
invoke(m, args);
}
Anyone know of a project or utility that does this?