summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2006-09-18 21:31:46 +0000
committerTom Tromey <tromey@redhat.com>2006-09-18 21:31:46 +0000
commitb6591f48586e483e3818ec20c50d1025bf4065d8 (patch)
tree0f1cd0f193d9547d2ceda053f5558ce5781b41f4
parent228fc33f661314b6723b691635085ee4ff6a69b2 (diff)
downloadclasspath-b6591f48586e483e3818ec20c50d1025bf4065d8.tar.gz
* java/util/concurrent/CopyOnWriteArrayList.java
(CopyOnWriteArrayList): New constructor.
-rw-r--r--ChangeLog5
-rw-r--r--java/util/concurrent/CopyOnWriteArrayList.java14
2 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d161f400a..72fee8383 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-18 Tom Tromey <tromey@redhat.com>
+
+ * java/util/concurrent/CopyOnWriteArrayList.java
+ (CopyOnWriteArrayList): New constructor.
+
2006-09-03 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* gnu/javax/swing/text/html/parser/HTML_401F.java (defineElements):
diff --git a/java/util/concurrent/CopyOnWriteArrayList.java b/java/util/concurrent/CopyOnWriteArrayList.java
index d116a0edc..ec2c90cc1 100644
--- a/java/util/concurrent/CopyOnWriteArrayList.java
+++ b/java/util/concurrent/CopyOnWriteArrayList.java
@@ -84,6 +84,20 @@ public class CopyOnWriteArrayList<E> extends AbstractList<E> implements
}
/**
+ * Construct a new ArrayList, and initialize it with the elements in the
+ * supplied array.
+ *
+ * @param array
+ * the array used to initialize this list
+ * @throws NullPointerException
+ * if array is null
+ */
+ public CopyOnWriteArrayList(E[] array)
+ {
+ data = array.clone();
+ }
+
+ /**
* Returns the number of elements in this list.
*
* @return the list size