You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2006/05/31 22:46:44 UTC
svn commit: r410663 -
/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java
Author: tellison
Date: Wed May 31 13:46:44 2006
New Revision: 410663
URL: http://svn.apache.org/viewvc?rev=410663&view=rev
Log:
Generics uplift for NetworkInterface
Modified:
incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java
Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java?rev=410663&r1=410662&r2=410663&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java Wed May 31 13:46:44 2006
@@ -120,7 +120,7 @@
*
* @return list of inet addresses bound to the interface
*/
- public Enumeration getInetAddresses() {
+ public Enumeration<InetAddress> getInetAddresses() {
// create new vector from which Enumeration to be returned can be
// generated set the initial capacity to be the number of addresses for
// the network interface which is the maximum required size
@@ -128,18 +128,18 @@
// return an empty enumeration if there are no addresses associated with the
// interface
if (addresses == null) {
- return new Vector(0).elements();
+ return new Vector<InetAddress>(0).elements();
}
// for those configuration that support the security manager we only
// return addresses for which checkConnect returns true
- Vector accessibleAddresses = new Vector(addresses.length);
+ Vector<InetAddress> accessibleAddresses = new Vector<InetAddress>(addresses.length);
// get the security manager. If one does not exist just return
// the full list
SecurityManager security = System.getSecurityManager();
if (security == null) {
- return (new Vector(Arrays.asList(addresses))).elements();
+ return (new Vector<InetAddress>(Arrays.asList(addresses))).elements();
}
// ok security manager exists so check each address and return
@@ -163,7 +163,7 @@
return accessibleAddresses.elements();
}
- return new Vector(0).elements();
+ return new Vector<InetAddress>(0).elements();
}
/**
@@ -247,7 +247,7 @@
// filtering
// Enumeration netifAddresses = netif.getInetAddresses();
if ((netif.addresses != null) && (netif.addresses.length != 0)) {
- Enumeration netifAddresses = (new Vector(Arrays
+ Enumeration netifAddresses = (new Vector<InetAddress>(Arrays
.asList(netif.addresses))).elements();
if (netifAddresses != null) {
while (netifAddresses.hasMoreElements()) {
@@ -273,12 +273,12 @@
* @throws SocketException
* if an error occurs when getting network interface information
*/
- public static Enumeration getNetworkInterfaces() throws SocketException {
+ public static Enumeration<NetworkInterface> getNetworkInterfaces() throws SocketException {
NetworkInterface[] interfaces = getNetworkInterfacesImpl();
if (interfaces == null) {
return null;
}
- return (new Vector(Arrays.asList(interfaces))).elements();
+ return (new Vector<NetworkInterface>(Arrays.asList(interfaces))).elements();
}
/**