changeset 2883:a6c142240837

4881419: The type of X[].clone() should be X[] Reviewed-by: martin
author darcy
date Fri, 03 Sep 2010 15:00:10 -0700
parents e17654f00d93
children 1f99ad63eb9e
files src/share/classes/java/lang/Object.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/Object.java	Fri Sep 03 21:03:45 2010 +0100
+++ b/src/share/classes/java/lang/Object.java	Fri Sep 03 15:00:10 2010 -0700
@@ -189,7 +189,9 @@
      * specific cloning operation. First, if the class of this object does
      * not implement the interface {@code Cloneable}, then a
      * {@code CloneNotSupportedException} is thrown. Note that all arrays
-     * are considered to implement the interface {@code Cloneable}.
+     * are considered to implement the interface {@code Cloneable} and that
+     * the return type of the {@code clone} method of an array type {@code T[]}
+     * is {@code T[]} where T is any reference or primitive type.
      * Otherwise, this method creates a new instance of the class of this
      * object and initializes all its fields with exactly the contents of
      * the corresponding fields of this object, as if by assignment; the