mirror of
https://github.com/corda/corda.git
synced 2025-02-09 12:21:22 +00:00
Make Vector a Cloneable
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
056c65947e
commit
6c46fe3f1a
@ -10,7 +10,7 @@
|
||||
|
||||
package java.util;
|
||||
|
||||
public class Vector<T> extends AbstractList<T> implements java.io.Serializable {
|
||||
public class Vector<T> extends AbstractList<T> implements java.io.Serializable, Cloneable {
|
||||
private final ArrayList<T> list;
|
||||
|
||||
public Vector(int capacity) {
|
||||
@ -126,5 +126,12 @@ public class Vector<T> extends AbstractList<T> implements java.io.Serializable {
|
||||
public Enumeration<T> elements() {
|
||||
return new Collections.IteratorEnumeration(iterator());
|
||||
}
|
||||
|
||||
|
||||
public synchronized Object clone() {
|
||||
Vector copy = new Vector(size());
|
||||
for (T t : this) {
|
||||
copy.add(t);
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user