In Java 5, the ExecutorService interface declares the method:
<T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks)
throws InterruptedException;
whereas Guava 11.0.2, written in Java 6 but supposedly compatible with Java 5, overrides it in ListeningExecutorService as:
<T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
throws InterruptedException;
If I want to implement my own ListeningExecutorService, I would need to implement both of these methods, but I am also not able to have two methods the same erasure, so it's a bit of a Catch 22.
Is there any way around this problem? More specifically, is there any way to implement a ListeningExecutorService in Java 5?
As a side note to any Guava folks--is it actually necessary for Guava to re-declare this method since it's already inherited from ExecutorService?
The original method signature has been reported as a bug and fixed for JDK 6: https://bugs.java.com/bugdatabase/view_bug?bug_id=6267833
To quote the resolution message:
- is binary compatible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With