Stop at a breakpoint, do a popFrames, and then an invokeMethod. An IncompatibleThreadStateException is thrown. The JDI spec for invokeMethod says: Method invocation can occur only if the specified thread has been suspended by an event which occurred in that thread. : @throws IncompatibleThreadStateException if the specified thread has not been suspended by an event. It seems logical to assume that if the thread is suspended by an event which occured in that thread, and a popFrames is done, the thread should still be considered to be suspended by an event, and so invokeMethod should be allowed.
|