/** * Executes the query in the event dispatch thread (EDT). This method waits until the action has finish its execution. * * @throws org.assertj.swing.exception.ActionFailedException if this task is not executed in the event dispatch thread * (EDT). */ @Override public final void run() { if (!isEventDispatchThread()) { throw actionFailure("Query should be executed in the event dispatch thread"); } try { result = executeInEDT(); } catch (Throwable t) { catchedException(t); } finally { notifyExecutionCompleted(); } }
@Nullable private static <T> T resultOf(@Nonnull GuiQuery<T> query) { T result = query.result(); query.clearResult(); rethrowCaughtExceptionIn(query); return result; }
@Nullable private static <T> T executeInCurrentThread(@Nonnull GuiQuery<T> query) { try { return query.executeInEDT(); } catch (Throwable e) { throw unexpected(e); } }