< prev index next >

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

Print this page

        

*** 97,107 **** /** * Creates a new Permissions object containing no PermissionCollections. */ public Permissions() { ! permsMap = new HashMap<Class<?>, PermissionCollection>(11); allPermission = null; } /** * Adds a permission object to the PermissionCollection for the class the --- 97,107 ---- /** * Creates a new Permissions object containing no PermissionCollections. */ public Permissions() { ! permsMap = new HashMap<>(11); allPermission = null; } /** * Adds a permission object to the PermissionCollection for the class the
*** 392,402 **** // 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.putAll(perms); // Set hasUnresolved UnresolvedPermissionCollection uc = (UnresolvedPermissionCollection) permsMap.get(UnresolvedPermission.class); --- 392,402 ---- // 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<>(perms.size()*2); permsMap.putAll(perms); // Set hasUnresolved UnresolvedPermissionCollection uc = (UnresolvedPermissionCollection) permsMap.get(UnresolvedPermission.class);
*** 486,496 **** /** * Create an empty PermissionsHash object. */ PermissionsHash() { ! permsMap = new HashMap<Permission, Permission>(11); } /** * Adds a permission to the PermissionsHash. * --- 486,496 ---- /** * Create an empty PermissionsHash object. */ PermissionsHash() { ! permsMap = new HashMap<>(11); } /** * Adds a permission to the PermissionsHash. *
*** 595,603 **** // 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.putAll(perms); } } --- 595,603 ---- // 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<>(perms.size()*2); permsMap.putAll(perms); } }
< prev index next >