This fixes the mauve regression noted by Paul Jenner for the
java.net.URLConnection.getHeaderFields test.
A case of slightly over zealous genericization.
2006-12-13 David Daney <[EMAIL PROTECTED]>
* java/lang/Collections.java
(UnmodifiableEntrySet.toArray): Fix bad casts.
Index: java/util/Collections.java
===================================================================
RCS file: /sources/classpath/classpath/java/util/Collections.java,v
retrieving revision 1.44
diff -u -p -r1.44 Collections.java
--- java/util/Collections.java 10 Dec 2006 20:25:46 -0000 1.44
+++ java/util/Collections.java 14 Dec 2006 07:23:20 -0000
@@ -5115,7 +5115,7 @@ public class Collections
// Map.Entry
public Map.Entry<K,V>[] toArray()
{
- Map.Entry<K,V>[] mapEntryResult = (Map.Entry<K,V>[]) super.toArray();
+ Object[] mapEntryResult = super.toArray();
UnmodifiableMapEntry<K,V> result[] = null;
if (mapEntryResult != null)
@@ -5123,7 +5123,7 @@ public class Collections
result = (UnmodifiableMapEntry<K,V>[])
new UnmodifiableMapEntry[mapEntryResult.length];
for (int i = 0; i < mapEntryResult.length; ++i)
- result[i] = new UnmodifiableMapEntry(mapEntryResult[i]);
+ result[i] = new UnmodifiableMapEntry<K,V>((Map.Entry<K,V>)mapEntryResult[i]);
}
return result;
}