summaryrefslogtreecommitdiff
path: root/libjava/classpath
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-27 17:28:08 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-27 17:28:08 +0000
commita5090a34f55b9c13775844b9b70e8bc41e2aab03 (patch)
tree80beb6a6626fd922b0c49b8d3ddd5f5734887d92 /libjava/classpath
parent6861ea448041942cb26ca22854d1d34907682a4f (diff)
downloadgcc-a5090a34f55b9c13775844b9b70e8bc41e2aab03.tar.gz
2010-04-27 Andrew Haley <aph@redhat.com>
* java/util/concurrent/CopyOnWriteArrayList.java: Fix for empty list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158790 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath')
-rw-r--r--libjava/classpath/ChangeLog5
-rw-r--r--libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java7
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$1.classbin2314 -> 2314 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.classbin1350 -> 1350 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.classbin2115 -> 2115 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.classbin1081 -> 1081 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.classbin4878 -> 4878 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.classbin11229 -> 11264 bytes
8 files changed, 11 insertions, 1 deletions
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index f98d1c95b1e..1db1158ff9a 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,5 +1,10 @@
2010-04-27 Andrew Haley <aph@redhat.com>
+ * java/util/concurrent/CopyOnWriteArrayList.java: Fix for empty
+ list.
+
+2010-04-27 Andrew Haley <aph@redhat.com>
+
* gnu/javax/print/ipp/IppResponse.java (parseAttributes): Handle
IppValueTag.UNKNOWN.
* gnu/javax/print/ipp/IppRequest.java (writeOperationAttributes):
diff --git a/libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java b/libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java
index 6e4fb9a8ac9..02071829269 100644
--- a/libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java
+++ b/libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java
@@ -452,7 +452,12 @@ public class CopyOnWriteArrayList<E>
public synchronized boolean remove(Object element)
{
E[] snapshot = this.data;
- E[] newData = (E[]) new Object[snapshot.length - 1];
+ int len = snapshot.length;
+
+ if (len == 0)
+ return false;
+
+ E[] newData = (E[]) new Object[len - 1];
// search the element to remove while filling the backup array
// this way we can run this method in O(n)
diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$1.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$1.class
index 2dba6818fd6..a8f5b0acb70 100644
--- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$1.class
+++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class
index 03ab92a5ec1..2ac97190710 100644
--- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class
+++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class
index 1f2e00af9ba..c20c1fecf97 100644
--- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class
+++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class
index 83fd284ec57..df5d0783cd3 100644
--- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class
+++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class
index 572a880ad34..12650197072 100644
--- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class
+++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class
index 0e7bd0f5aee..97d63d83b3f 100644
--- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class
+++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class
Binary files differ