Code review request for 4881419 The type of X[].clone() should be X[]

Ulf Zibis Ulf.Zibis at gmx.de
Fri Sep 3 01:07:13 UTC 2010



Am 03.09.2010 02:50, schrieb Joe Darcy:
> Martin Buchholz wrote:
>> The usage T[] suggests that T is a reference type, as with generics, which is not the case here.
>>
>> More precisely, both the runtime types and compiletime types of the object returned from clone of 
>> any array is identical to its input.
>> Is there a non-confusing way of saying that?
>
> How about
>
> "...and that the return type of the {@code clone} method of an array type {@code T[]} is {@code 
> T[]} where T is either a reference or a primitive type."?
>

How about

"...and that the return type of the {@code clone} method of an array type {@code X[]} is {@code X[]} 
where X is either a *raw* reference or a primitive type."?

-Ulf

> -Joe
>
>>
>> Martin
>>
>> On Thu, Sep 2, 2010 at 17:33, Joe Darcy <joe.darcy at oracle.com <mailto:joe.darcy at oracle.com>> wrote:
>>
>>     Hello.
>>
>>     Please review my spec clarification fix for
>>
>>       4881419 "The type of X[].clone() should be X[]"
>>       http://cr.openjdk.java.net/~darcy/4881419/
>> <http://cr.openjdk.java.net/%7Edarcy/4881419/>
>>
>>     The statement about the return type of the clone method for an
>>     array is given in JLSv3 section 6.4.5:
>>     http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.4.5
>>
>>     Thanks,
>>
>>     -Joe
>>
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20100903/4cb8113d/attachment.html>


More information about the core-libs-dev mailing list