Imported Classpath 0.18.
* sources.am, Makefile.in: Updated. * Makefile.am (nat_source_files): Removed natProxy.cc. * java/lang/reflect/natProxy.cc: Removed. * gnu/classpath/jdwp/VMFrame.java, gnu/classpath/jdwp/VMIdManager.java, gnu/classpath/jdwp/VMVirtualMachine.java, java/lang/reflect/VMProxy.java: New files. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC list. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/net/DefaultContentHandlerFactory.java (getContent): Remove ClasspathToolkit references. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/awt/xlib/XCanvasPeer.java: Add new peer methods. * gnu/awt/xlib/XFramePeer.java: Likewise. * gnu/awt/xlib/XGraphicsConfiguration.java: Likewise. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add classpath/native/jawt/jawt.c. * Makefile.in: Regenerate. * jawt.c: Remove file. * include/Makefile.am (tool_include__HEADERS): Remove jawt.h and jawt_md.h. Add ../classpath/include/jawt.h and ../classpath/include/jawt_md.h. * include/Makefile.in: Regenerate. * include/jawt.h: Regenerate. * include/jawt_md.h: Regenerate. From-SVN: r104586
This commit is contained in:
parent
9b044d1951
commit
1ea63ef8be
544 changed files with 34724 additions and 14512 deletions
|
@ -38,7 +38,12 @@ exception statement from your version. */
|
|||
|
||||
package java.net;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
|
@ -143,9 +148,7 @@ public final class NetworkInterface
|
|||
public static NetworkInterface getByName(String name)
|
||||
throws SocketException
|
||||
{
|
||||
Vector networkInterfaces = VMNetworkInterface.getInterfaces();
|
||||
|
||||
for (Enumeration e = networkInterfaces.elements(); e.hasMoreElements();)
|
||||
for (Enumeration e = getNetworkInterfaces(); e.hasMoreElements();)
|
||||
{
|
||||
NetworkInterface tmp = (NetworkInterface) e.nextElement();
|
||||
|
||||
|
@ -170,9 +173,7 @@ public final class NetworkInterface
|
|||
public static NetworkInterface getByInetAddress(InetAddress addr)
|
||||
throws SocketException
|
||||
{
|
||||
Vector networkInterfaces = VMNetworkInterface.getInterfaces();
|
||||
|
||||
for (Enumeration interfaces = networkInterfaces.elements();
|
||||
for (Enumeration interfaces = getNetworkInterfaces();
|
||||
interfaces.hasMoreElements();)
|
||||
{
|
||||
NetworkInterface tmp = (NetworkInterface) interfaces.nextElement();
|
||||
|
@ -188,6 +189,41 @@ public final class NetworkInterface
|
|||
throw new SocketException("no network interface is bound to such an IP address");
|
||||
}
|
||||
|
||||
static private Collection condense(Collection interfaces)
|
||||
{
|
||||
final Map condensed = new HashMap();
|
||||
|
||||
final Iterator interfs = interfaces.iterator();
|
||||
while (interfs.hasNext()) {
|
||||
|
||||
final NetworkInterface face = (NetworkInterface) interfs.next();
|
||||
final String name = face.getName();
|
||||
|
||||
if (condensed.containsKey(name))
|
||||
{
|
||||
final NetworkInterface conface = (NetworkInterface) condensed.get(name);
|
||||
if (!conface.inetAddresses.containsAll(face.inetAddresses))
|
||||
{
|
||||
final Iterator faceAddresses = face.inetAddresses.iterator();
|
||||
while (faceAddresses.hasNext())
|
||||
{
|
||||
final InetAddress faceAddress = (InetAddress) faceAddresses.next();
|
||||
if (!conface.inetAddresses.contains(faceAddress))
|
||||
{
|
||||
conface.inetAddresses.add(faceAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
condensed.put(name, face);
|
||||
}
|
||||
}
|
||||
|
||||
return condensed.values();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an <code>Enumeration</code> of all available network interfaces
|
||||
*
|
||||
|
@ -202,7 +238,9 @@ public final class NetworkInterface
|
|||
if (networkInterfaces.isEmpty())
|
||||
return null;
|
||||
|
||||
return networkInterfaces.elements();
|
||||
Collection condensed = condense(networkInterfaces);
|
||||
|
||||
return Collections.enumeration(condensed);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue