|
From: Max R. A. <max...@jb...> - 2006-07-12 17:40:22
|
yes, i realized this (also explained on the bug).
What tricked me was that neither I or emmanuel must have been using
the latest javac ;)
/max
> That is a rather basic generics error that is a bug in javac since
> Properties is typed as Map<Object,Object>, not Map<String,String>. You=
> are asking to be able to do (replacing ? with String to be more
> concrete):
>
> Map<Object,Object> m1 =3D ...;
> Map<String,String> m2 =3D (Map<String,String>) m1;
>
> javac disallows this as it should since one would be able to do the
> following otherwise:
> m1.put("one", new Integer(1));
> String one =3D m2.get("one"); // CCE since Integer !instanceof String
>
> In the Properties case javac must be getting lost in the non-trivial
> inheritance tree. See the following for discussions of the less
> intuitive aspects of generics:
> http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
>
>> -----Original Message-----
>> From: hib...@li...
>> [mailto:hib...@li...] On
>> Behalf Of Max Rydahl Andersen
>> Sent: Wednesday, July 12, 2006 3:57 AM
>> To: Hibernate development
>> Subject: [Hibernate] eclipse chokes on current annotations code
>>
>>
>> javac works fine, but eclipse chokes on casting Properties to
>> Map<String, ?>
>>
>> I've bugged eclipse about it to see what they provide as explanation.=
>>
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D150362
>>
-- =
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
ma...@hi...
http://hibernate.org
JBoss Inc
max...@jb...
|