You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code does not throw any exceptions.
If you do not call the get() method of the Future returned by async(), exceptions during execution will be masked in the callCallableAndSetFuture method. But when using the async() call I actually do not want to wait for the result.
I'm not completely done yet, as the Exception handling is not that easy to follow and different types of execution models with different kinds of exception handling are used (Runnables, callables with/without Executors...). But I think this is at least true for all the async..(...) methods. The waitForAsync...(...)Methods do check the exceptions later.
In my opinion this is dangerous, especially in the public API.
Current test case
The current test case is also invalid, the Exception is thrown by another method (see comment below).
I'm not completely done yet, but the simplest solution would be to remove the try catch block in callCallableAndSetFuture, if called from one of the async methods (extra method for async calls).
The text was updated successfully, but these errors were encountered:
Ortner
pushed a commit
to Ortner/TestFX
that referenced
this issue
May 21, 2016
Improve exception handling methods and allow the user to have more
control.
Fixed async_callable_with_exception to detect that no exception is
thrown.
Add testing for exceptions thrown on JavaFX application thread.
ClosesTestFX#280ClosesTestFX#281
Issue
There are several vulnerabilities in the WaitForAsyncUtils. Public methods require Exception handling, where it is not obvious.
The following code snippet serves as example:
This code does not throw any exceptions.
If you do not call the
get()
method of the Future returned byasync()
, exceptions during execution will be masked in thecallCallableAndSetFuture
method. But when using theasync()
call I actually do not want to wait for the result.I'm not completely done yet, as the Exception handling is not that easy to follow and different types of execution models with different kinds of exception handling are used (Runnables, callables with/without Executors...). But I think this is at least true for all the
async..(...)
methods. ThewaitForAsync...(...)
Methods do check the exceptions later.In my opinion this is dangerous, especially in the public API.
Current test case
The current test case is also invalid, the Exception is thrown by another method (see comment below).
Possible relations
Proposal
I'm not completely done yet, but the simplest solution would be to remove the try catch block in
callCallableAndSetFuture
, if called from one of the async methods (extra method for async calls).The text was updated successfully, but these errors were encountered: