@Nullable private static <T> T resultOf(@Nonnull GuiQuery<T> query) { T result = query.result(); query.clearResult(); rethrowCaughtExceptionIn(query); return result; }
/** * Executes the given task in the event dispatch thread (EDT). This method waits until the task has finished its * execution. * * @param task the task to execute. * @throws org.assertj.swing.exception.UnexpectedException wrapping any <b>checked</b> exception thrown when executing * the given query in the * event dispatch thread (EDT). Unchecked exceptions are re-thrown without any wrapping. * @see #executeInEDT() * @see #execute(GuiActionRunnable) */ public static void execute(@Nonnull GuiTask task) { if (!executeInEDT) { executeInCurrentThread(task); return; } run(task); rethrowCaughtExceptionIn(task); }