aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2007-02-12 23:52:39 +0000
committerTom Tromey <tromey@gcc.gnu.org>2007-02-12 23:52:39 +0000
commit40b86e5f2cf069832e23043992dedb0bf8e0dcd6 (patch)
treee330b8e9a136b5340488dc4c338504cc6b870e5b /libjava/classpath/java
parente8c30b5f9a11fed775dddf8c15706ae251fdd2d5 (diff)
downloadgcc-40b86e5f2cf069832e23043992dedb0bf8e0dcd6.zip
gcc-40b86e5f2cf069832e23043992dedb0bf8e0dcd6.tar.gz
gcc-40b86e5f2cf069832e23043992dedb0bf8e0dcd6.tar.bz2
Collections.java (UnmodifiableMap.toArray): Imported changes from Classpath.
libjava/classpath * java/util/Collections.java (UnmodifiableMap.toArray): Imported changes from Classpath. libjava * sources.am, Makefile.in: Rebuilt. * java/lang/Socket.java: Removed override. * java/lang/DatagramSocket.java: Removed override. * gnu/java/net/PlainSocketImpl.java (localSocketAddress): New field. (getLocalAddress): New method. * gnu/java/net/PlainDatagramSocketImpl.java (PlainDatagramSocketImpl): Throws IOException. * gnu/java/net/natPlainSocketImplPosix.cc (write): Remove 'sizeof'. (read): Likewise. From-SVN: r121866
Diffstat (limited to 'libjava/classpath/java')
-rw-r--r--libjava/classpath/java/util/Collections.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/libjava/classpath/java/util/Collections.java b/libjava/classpath/java/util/Collections.java
index c15fa09..77ff6ed 100644
--- a/libjava/classpath/java/util/Collections.java
+++ b/libjava/classpath/java/util/Collections.java
@@ -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,21 +5123,21 @@ 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;
}
// The array returned is an array of UnmodifiableMapEntry instead of
// Map.Entry
- public Map.Entry<K,V>[] toArray(Map.Entry<K,V>[] array)
+ public <S> S[] toArray(S[] array)
{
- super.toArray(array);
+ S[] result = super.toArray(array);
- if (array != null)
- for (int i = 0; i < array.length; i++)
+ if (result != null)
+ for (int i = 0; i < result.length; i++)
array[i] =
- new UnmodifiableMapEntry<K,V>(array[i]);
+ (S) new UnmodifiableMapEntry<K,V>((Map.Entry<K,V>) result[i]);
return array;
}