I have a futures task that is doing some I/O operations over the socket to a server. When I use the get() method of the task to retrieve the result, I am getting ExecutionException, but with no cause i.e. getCause() returns null. In what scenario does this happen? I mean, I'm getting this exception since the task threw some exception right , but how can it go missing?

有帮助吗?

解决方案

throw null;

is legal in Java, but I've never seen that in the wild.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top