src/share/classes/java/util/ArrayList.java

Print this page
rev 4788 : Fix bunch of generics warnings

*** 298,309 **** * * @return a clone of this <tt>ArrayList</tt> instance */ public Object clone() { try { ! @SuppressWarnings("unchecked") ! ArrayList<E> v = (ArrayList<E>) super.clone(); v.elementData = Arrays.copyOf(elementData, size); v.modCount = 0; return v; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable --- 298,308 ---- * * @return a clone of this <tt>ArrayList</tt> instance */ public Object clone() { try { ! ArrayList<?> v = (ArrayList<?>) super.clone(); v.elementData = Arrays.copyOf(elementData, size); v.modCount = 0; return v; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable