commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <joerg.schai...@gmx.de>
Subject Re: [POOL] can the CheckedObjectPool be removed when introducing Java5 generics?
Date Tue, 12 Oct 2010 09:06:03 GMT
Hi Simone,

Simone Tripodi wrote:

> Hi all mates,
> please help me, even if I temporary fixed the compiler issue, I didn't
> understand why
> 
>   <K,V> void prefill(final KeyedObjectPool<K,V> keyedPool, final K
> key, final int count) throws Exception, IllegalArgumentException
>   <K,V> void prefill(final KeyedObjectPool<K,V> keyedPool, final
> Collection<K> keys, final int count) throws Exception,
> IllegalArgumentException
> 
> when using Object as K so problem is represented. Please help me
> understand because it's driving me crazy.
> I noticed Eclipse ignores it, javac from command line not...
> 
> Many thanks in advance for saving my mental health :)
> Simo

You cannot trust the Eclipse compiler when using generics. It is a lot 
smarter then Sun's javac. Collection is an Object and therefore Sun's 
compiler does not know for if it should use the method with K or 
Collection<K> if that parameter is an collection of objects :-/

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message