[concurrency-interest] Incompatible API change between Java 5 and Java 6?

Péter Kovács peter.kovacs.1.0rc at gmail.com
Fri Apr 10 07:47:55 EDT 2009


You presumably meant:

public List invokeAll(Collection tasks)
          throws InterruptedException

Thanks a lot, that appears to work.
Peter

2009/4/10 Rémi Forax <forax at univ-mlv.fr>:
> Péter Kovács a écrit :
>>
>> Hi,
>>
>> It appears that the signature of invokeAny and invokeAll in
>> ExecutorService has changed from Java 5 and Java 6. I want to
>> implement this interface, but I cannot find a signature which is
>> accepted by both versions of javac. I have tried this one (accepted by
>> Java 5 only):
>>
>> public <T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks)
>>            throws InterruptedException
>>
>> and this one  (accepted by Java 6 only):
>>
>> public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>>
>> tasks)
>>            throws InterruptedException
>>
>> Any suggestion appreciated.
>>
>> Thanks
>> Peter
>>
>
> You can use a raw type, you will get warnings but no error.
>
> public <T> List<Future<T>> invokeAll(Collection tasks)
>           throws InterruptedException
>
>
>> PS:
>> Generics: much ado about nothing.
>>
>
> Rémi
>



More information about the Concurrency-interest mailing list