"scott.stark(a)jboss.org" wrote : I don't understand why you don't
value.getClass() is not the same ParameterizedType that you get from the field/method
getGenericType()/getGenericReturnType().
The generic types only survive on the compile time view,
e.g. constructors, methods, fields, etc.
they aren't used anywhere else.
e.g. what should this do? Should it change the value from getClass() as you cast? :-)
| public void doSomething(HashMap<String, String> map)
| {
| HashMap erased = (HashMap) map; // erased.getClass() == plain class
| HashMap<String, String> unerased = erased; // unerased.getClass() ==
parameterized type
| }
|
It would also break backwards compatibility if this wasn't true
| assert unerased.getClass() == erased.getClass();
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134678#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...