I'm checking this in on the generics branch.
This fixes PR 29086 by removing a bogus catch.
I looked at the other toArray methods but they are fine.
Tom
2006-10-21 Tom Tromey <[EMAIL PROTECTED]>
PR classpath/29086:
* java/util/AbstractCollection.java (toArray): Removed cast.
Index: java/util/AbstractCollection.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/AbstractCollection.java,v
retrieving revision 1.14.2.6
diff -u -r1.14.2.6 AbstractCollection.java
--- java/util/AbstractCollection.java 2 Mar 2006 09:33:59 -0000 1.14.2.6
+++ java/util/AbstractCollection.java 21 Oct 2006 23:13:49 -0000
@@ -416,17 +416,7 @@
Iterator<E> itr = iterator();
for (int pos = 0; pos < size; pos++)
- {
- try
- {
- a[pos] = (T) (itr.next());
- }
- catch (ClassCastException exception)
- {
- throw new ArrayStoreException("The element is of the wrong type "+
- "for storing in this array.");
- }
- }
+ a[pos] = (T) (itr.next());
return a;
}