GT-2875 - Unswingable - review fixes

This commit is contained in:
dragonmacher 2019-05-21 10:10:13 -04:00
parent bc2fb09ec5
commit 5e8340b7f8
7 changed files with 106 additions and 62 deletions

View file

@ -105,8 +105,10 @@ public class Swing {
/**
* Calls the given suppler on the Swing thread, blocking with a
* {@link SwingUtilities#invokeAndWait(Runnable)}. Use this method when you need to get
* a value while being on the Swing thread.
* {@link SwingUtilities#invokeAndWait(Runnable)} if not on the Swing thread.
*
* <p>Use this method when you are not on the Swing thread and you need to get a value
* that is managed/synchronized by the Swing thread.
*
* <pre>
* String value = runNow(() -> label.getText());
@ -195,9 +197,9 @@ public class Swing {
"Timed-out waiting for Swing thread lock in " + timeout + " " + unit);
}
// we've started!
// we've started; wait for the runnable with no timeout
try {
end.await(); // wait FOREVER!
end.await();
}
catch (InterruptedException e) {
// we sometimes interrupt our tasks intentionally, so don't report it