< prev index next >

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

Print this page

        

@@ -1192,11 +1192,11 @@
      * Check the system/security property for the ephemeral port range
      * for this system. The suffix is either "high" or "low"
      */
     private static int initEphemeralPorts(String suffix, int defval) {
         return AccessController.doPrivileged(
-            new PrivilegedAction<Integer>(){
+            new PrivilegedAction<>(){
                 public Integer run() {
                     int val = Integer.getInteger(
                             "jdk.net.ephemeralPortRange."+suffix, -1
                     );
                     if (val != -1) {

@@ -1326,11 +1326,11 @@
      * Create an empty SocketPermissions object.
      *
      */
 
     public SocketPermissionCollection() {
-        perms = new ArrayList<SocketPermission>();
+        perms = new ArrayList<>();
     }
 
     /**
      * Adds a permission to the SocketPermissions. The key for the hash is
      * the name in the case of wildcards, or all the IP addresses.

@@ -1464,9 +1464,9 @@
         ObjectInputStream.GetField gfields = in.readFields();
 
         // Get the one we want
         @SuppressWarnings("unchecked")
         Vector<SocketPermission> permissions = (Vector<SocketPermission>)gfields.get("permissions", null);
-        perms = new ArrayList<SocketPermission>(permissions.size());
+        perms = new ArrayList<>(permissions.size());
         perms.addAll(permissions);
     }
 }
< prev index next >