[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Using a CompositeMetaType for a Map with String keys?
adrian@jboss.org
do-not-reply at jboss.com
Thu Mar 6 15:48:12 EST 2008
"scott.stark at 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#4134678
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134678
More information about the jboss-dev-forums
mailing list