Code review request for 4881419 The type of X[].clone() should be X[]
Joe Darcy
joe.darcy at oracle.com
Tue Sep 7 16:19:52 UTC 2010
Jeroen Frijters wrote:
> David Holmes wrote:
>
>> The fact that Object.clone() is implemented via a native call into the
>> VM is simply an implementation detail.
>>
>
> That's not what we're talking about. We're talking about the fact that arrays (appear to) have a *public* clone method. The argument is about the return type[1] of this method: according to the JLS it is X[], but according to the VMSpec it is Object. This difference is fine, but I'm arguing that the JLS fiction should be in the JLS, not in the Object.clone() documentation.
>
> Regards,
> Jeroen
>
> [1] Not the runtime class of the object returned.
>
The documentation for the *Java* class libraries is written in the
*Java* programming language and there are selected references and
dependencies between the library and language specifications.
-Joe
More information about the core-libs-dev
mailing list