-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0, 1.4.0
-
b26
-
generic
-
generic
As part of JSR-14 (generics), covariant returns were added to the language. The JSR-14 expert group therefore recommends that the clone method on arrays should return an object of the "correct" type, so than casting is no longer required to copy an array:
int[] original = ...;
int[] copy = original.clone();
int[] original = ...;
int[] copy = original.clone();
- duplicates
-
JDK-4619338 Convenience method for generic array copying
- Closed
- relates to
-
JDK-4919255 the type of x.getClass() is Class<? extends X>
- Resolved