diff -r f850b9d09c91 -r 6efd719b3330 jdk/src/java.base/share/classes/java/util/Arrays.java --- a/jdk/src/java.base/share/classes/java/util/Arrays.java Thu Jul 09 09:55:36 2015 -0400 +++ b/jdk/src/java.base/share/classes/java/util/Arrays.java Mon Jun 29 15:02:35 2015 -0700 @@ -3820,7 +3820,7 @@ @Override public Object[] toArray() { - return a.clone(); + return Arrays.copyOf(a, a.length, Object[].class); } @Override