RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class
Remi Forax
forax at univ-mlv.fr
Sat Jun 27 10:19:04 UTC 2015
oh, doh,
you're right :)
I still think that the right type is Class<? extends T[]>.
Rémi
On 06/27/2015 01:04 AM, Martin Buchholz wrote:
>
>
> On Fri, Jun 26, 2015 at 3:46 PM, Remi Forax <forax at univ-mlv.fr
> <mailto: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