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
This commit is contained in:
parent
e8c30b5f9a
commit
40b86e5f2c
17 changed files with 84 additions and 2252 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue