Yeah... this isn't real obvious.

But the problem is type erasure.

See here for a discussion:
http://code.google.com/p/google-gson/issues/detail?id=45

On Mon, May 31, 2010 at 10:04 AM, Sean Owen <[email protected]> wrote:

> While wandering through the code I saw this construction:
>
>    Type vectorType = new TypeToken<Vector>() {}.getType();
>
> from reading the GSON source, it seems this is really just a long way of
> saying:
>
>    Type vectorType = Vector.class;
>
> am I missing anything? would be nice to not construct a new anonymous
> class in these 5 instances or so.
> But it's minor.
>

Reply via email to