Rooks Forgenal wrote:Please note the comment. This error is requiring me to cast the executed object... I don't see why I would have to. Any suggestions?
T, at that point, can be of any type. ExecutorService#submit() takes a Future. Not all Objects are Futures, therefore the compiler can not assume that object to run is a Callable. Try making it like:
Then, the compiler should know that every possible T is a callable, and
you should not have to cast it. I think - I haven't tried.