diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-27 17:28:08 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-27 17:28:08 +0000 |
commit | a5090a34f55b9c13775844b9b70e8bc41e2aab03 (patch) | |
tree | 80beb6a6626fd922b0c49b8d3ddd5f5734887d92 /libjava/classpath | |
parent | 6861ea448041942cb26ca22854d1d34907682a4f (diff) | |
download | gcc-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/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java | 7 | ||||
-rw-r--r-- | libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$1.class | bin | 2314 -> 2314 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class | bin | 1350 -> 1350 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class | bin | 2115 -> 2115 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class | bin | 1081 -> 1081 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class | bin | 4878 -> 4878 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class | bin | 11229 -> 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 Binary files differindex 2dba6818fd6..a8f5b0acb70 100644 --- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$1.class +++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$1.class diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class Binary files differindex 03ab92a5ec1..2ac97190710 100644 --- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class +++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$2.class diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class Binary files differindex 1f2e00af9ba..c20c1fecf97 100644 --- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class +++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$3.class diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class Binary files differindex 83fd284ec57..df5d0783cd3 100644 --- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class +++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$RandomAccessSubList.class diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class Binary files differindex 572a880ad34..12650197072 100644 --- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class +++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList$SubList.class diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class Binary files differindex 0e7bd0f5aee..97d63d83b3f 100644 --- a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class +++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class |