[concurrency-interest] ReentrantReadWriteLock backportnon-matchingsignature

Dawid Kurzyniec dawidk at mathcs.emory.edu
Sun Jul 9 11:50:19 EDT 2006


Moran Avigdor wrote:
> Dawid,
>
> You can narrow the backport implementation to return ReadLock and 
> WriteLock respectively,
> instead of returning the Lock interface. This will then have the same 
> signature as Java 5.0
>
>   

No, unfortunately, this won't compile under Java 1.4 due to 
"incompatible return types". The ability to narrow return types in 
subclasses and implementation classes was added alongside generics in 
Java 5.0.

Regards,
Dawid



More information about the Concurrency-interest mailing list