void () { if (myPassThroughMode) { checkThread(null); } else if (!EventQueue.isDispatchThread()) { myCancelRequest = new AssertionFailedError("Must be event dispatch thread"); throw new RuntimeException(myCancelRequest); } }