< prev index next >

src/java.base/share/classes/java/net/NetworkInterface.java

Print this page

        

@@ -52,11 +52,11 @@
     private static final NetworkInterface defaultInterface;
     private static final int defaultIndex; /* index of defaultInterface */
 
     static {
         AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
+            new java.security.PrivilegedAction<>() {
                 public Void run() {
                     System.loadLibrary("net");
                     return null;
                 }
             });

@@ -165,11 +165,11 @@
      * @return a {@code List} object with all or a subset of the
      *         InterfaceAddresss of this network interface
      * @since 1.6
      */
     public java.util.List<InterfaceAddress> getInterfaceAddresses() {
-        java.util.List<InterfaceAddress> lst = new java.util.ArrayList<InterfaceAddress>(1);
+        java.util.List<InterfaceAddress> lst = new java.util.ArrayList<>(1);
         SecurityManager sec = System.getSecurityManager();
         for (int j=0; j<bindings.length; j++) {
             try {
                 if (sec != null) {
                     sec.checkConnect(bindings[j].getAddress().getHostAddress(), -1);

@@ -344,11 +344,11 @@
 
         // specified to return null if no network interfaces
         if (netifs == null)
             return null;
 
-        return new Enumeration<NetworkInterface>() {
+        return new Enumeration<>() {
             private int i = 0;
             public NetworkInterface nextElement() {
                 if (netifs != null && i < netifs.length) {
                     NetworkInterface netif = netifs[i++];
                     return netif;
< prev index next >