RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

Martin Buchholz martinrb at google.com
Fri Jun 26 23:04:07 UTC 2015


On Fri, Jun 26, 2015 at 3:46 PM, Remi Forax <forax at univ-mlv.fr> wrote:

>
> as a matter of style, i prefer to always have curly braces after an 'if'
>

Community opinion is moving your way, but I am holding out.


> and i think that the cast to (Class<T[]>) is no longer needed
> (and false if one day generics are fully reified because the right type is
> Class<? extends T[]>).
>
>
"""The actual result type is Class<? extends |X|> where |X| is the erasure
of the static type of the expression on which getClass is called."""

But erased types can't contain "T".



More information about the core-libs-dev mailing list