I'll leave it open to debate if this classes as reflection, but the most
common use-case I see for reification goes something like:
if (x instanceof List<Integer>) then { ... }
else if (x instanceof List<String>) then { ... }
else { ... }
But if that's what you want, there are some fairly simple workarounds for
the issues of erasure.
2010/8/31 Cédric Beust ♔ <[email protected]>
> Hi Russel,
>
> On Tue, Aug 31, 2010 at 7:51 AM, Russel Winder <[email protected]>wrote:
>
>> Perhaps the JVM could then support type parameters and the abomination
>> that is type erasure could be dispensed with.
>>
>
> I'm surprised by the intensity of your statement, it's quite unusual coming
> from you :-)
>
> In a regular Java code base, I would say that the amount of reflection is
> very low, probably 5% or less (already a generous number in my opinion,
> since most of it is probably because of annotations).
>
> Out of these 5%, how much really needs access to erased type information?
> That number is probably vanishingly small.
>
> And the thing is: if you really need this information, you can have it to
> some extent with
>
> - getGenericType
> - Or even better, the very clever
> TypeLiteral<http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/TypeLiteral.html>
> .
>
> Overall, I think erasure has worked very well in practice, so I'm curious
> to hear why you think it's such a disaster?
>
> --
> Cédric
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<javaposse%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>
--
Kevin Wright
mail/google talk: [email protected]
wave: [email protected]
skype: kev.lee.wright
twitter: @thecoda
--
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en.