--- old/tools/Jemmy/JemmyFX/src/org/jemmy/fx/QueueExecutor.java 2016-12-09 13:28:23.894869468 +0300 +++ new/tools/Jemmy/JemmyFX/src/org/jemmy/fx/QueueExecutor.java 2016-12-09 13:28:23.842869000 +0300 @@ -41,7 +41,7 @@ public class QueueExecutor extends AbstractExecutor { /** - * @see #isQuiet() + * @see #isQuiet() */ public static final Timeout QUEUE_THROUGH_TIME = new Timeout("FXExecutor.FX_QUEUE_THROUGH_TIME", 50); static final Timeout QUEUE_IDENTIFYING_TIMEOUT = @@ -90,9 +90,9 @@ /** * {@inheritDoc} - * @param env + * @param env * @param action - * @param parameters + * @param parameters */ @Override public void executeQueue(Environment env, Action action, Object... parameters) { @@ -112,9 +112,9 @@ /** * {@inheritDoc} - * @param env - * @param action - * @param parameters + * @param env + * @param action + * @param parameters */ @Override public void executeQueueDetached(Environment env, Action action, Object... parameters) { @@ -125,7 +125,7 @@ } /** - * Checks whether the calling code is already on the queue thread. + * Checks whether the calling code is already on the queue thread. * @return */ @Override @@ -141,7 +141,7 @@ /** * Checks whether the things are "quiet". All is currently does is check that - * something comes through the queue quickly enough as defined by + * something comes through the queue quickly enough as defined by * QUEUE_THROUGH_TIME timeout. * @return */ @@ -222,7 +222,7 @@ } public boolean failed() { - return action.failed(); + return !done || action.failed(); } public Throwable getThrowable() { @@ -231,8 +231,9 @@ public synchronized void waitDone(Timeout timeout) { try { - while (!done) { - wait(timeout.getValue()); + long maxTime = System.currentTimeMillis() + timeout.getValue(); + while (!done && System.currentTimeMillis() < maxTime) { + wait(maxTime - System.currentTimeMillis()); } } catch (InterruptedException ex) { }