< prev index next >

src/java.base/share/classes/java/security/Permissions.java

Print this page

        

@@ -97,11 +97,11 @@
 
     /**
      * Creates a new Permissions object containing no PermissionCollections.
      */
     public Permissions() {
-        permsMap = new HashMap<Class<?>, PermissionCollection>(11);
+        permsMap = new HashMap<>(11);
         allPermission = null;
     }
 
     /**
      * Adds a permission object to the PermissionCollection for the class the

@@ -392,11 +392,11 @@
         // writeObject writes a Hashtable<Class<?>, PermissionCollection> for
         // the perms key, so this cast is safe, unless the data is corrupt.
         @SuppressWarnings("unchecked")
         Hashtable<Class<?>, PermissionCollection> perms =
             (Hashtable<Class<?>, PermissionCollection>)gfields.get("perms", null);
-        permsMap = new HashMap<Class<?>, PermissionCollection>(perms.size()*2);
+        permsMap = new HashMap<>(perms.size()*2);
         permsMap.putAll(perms);
 
         // Set hasUnresolved
         UnresolvedPermissionCollection uc =
         (UnresolvedPermissionCollection) permsMap.get(UnresolvedPermission.class);

@@ -486,11 +486,11 @@
     /**
      * Create an empty PermissionsHash object.
      */
 
     PermissionsHash() {
-        permsMap = new HashMap<Permission, Permission>(11);
+        permsMap = new HashMap<>(11);
     }
 
     /**
      * Adds a permission to the PermissionsHash.
      *

@@ -595,9 +595,9 @@
         // writeObject writes a Hashtable<Class<?>, PermissionCollection> for
         // the perms key, so this cast is safe, unless the data is corrupt.
         @SuppressWarnings("unchecked")
         Hashtable<Permission, Permission> perms =
                 (Hashtable<Permission, Permission>)gfields.get("perms", null);
-        permsMap = new HashMap<Permission, Permission>(perms.size()*2);
+        permsMap = new HashMap<>(perms.size()*2);
         permsMap.putAll(perms);
     }
 }
< prev index next >