equal
deleted
inserted
replaced
811 * |
811 * |
812 * @return a copy of this deque |
812 * @return a copy of this deque |
813 */ |
813 */ |
814 public ArrayDeque<E> clone() { |
814 public ArrayDeque<E> clone() { |
815 try { |
815 try { |
816 ArrayDeque<E> result = (ArrayDeque<E>) super.clone(); |
816 @SuppressWarnings("unchecked") |
|
817 ArrayDeque<E> result = (ArrayDeque<E>) super.clone(); |
817 result.elements = Arrays.copyOf(elements, elements.length); |
818 result.elements = Arrays.copyOf(elements, elements.length); |
818 return result; |
819 return result; |
819 |
820 |
820 } catch (CloneNotSupportedException e) { |
821 } catch (CloneNotSupportedException e) { |
821 throw new AssertionError(); |
822 throw new AssertionError(); |
847 } |
848 } |
848 |
849 |
849 /** |
850 /** |
850 * Deserialize this deque. |
851 * Deserialize this deque. |
851 */ |
852 */ |
|
853 @SuppressWarnings("unchecked") |
852 private void readObject(ObjectInputStream s) |
854 private void readObject(ObjectInputStream s) |
853 throws IOException, ClassNotFoundException { |
855 throws IOException, ClassNotFoundException { |
854 s.defaultReadObject(); |
856 s.defaultReadObject(); |
855 |
857 |
856 // Read in size and allocate array |
858 // Read in size and allocate array |