< prev index next >
src/java.base/share/classes/java/security/BasicPermission.java
Print this page
*** 330,340 ****
* Create an empty BasicPermissionCollection object.
*
*/
public BasicPermissionCollection(Class<?> clazz) {
! perms = new HashMap<String, Permission>(11);
all_allowed = false;
permClass = clazz;
}
/**
--- 330,340 ----
* Create an empty BasicPermissionCollection object.
*
*/
public BasicPermissionCollection(Class<?> clazz) {
! perms = new HashMap<>(11);
all_allowed = false;
permClass = clazz;
}
/**
*** 531,541 ****
// writeObject writes a Hashtable<String, Permission> for the
// permissions key, so this cast is safe, unless the data is corrupt.
@SuppressWarnings("unchecked")
Hashtable<String, Permission> permissions =
(Hashtable<String, Permission>)gfields.get("permissions", null);
! perms = new HashMap<String, Permission>(permissions.size()*2);
perms.putAll(permissions);
// Get all_allowed
all_allowed = gfields.get("all_allowed", false);
--- 531,541 ----
// writeObject writes a Hashtable<String, Permission> for the
// permissions key, so this cast is safe, unless the data is corrupt.
@SuppressWarnings("unchecked")
Hashtable<String, Permission> permissions =
(Hashtable<String, Permission>)gfields.get("permissions", null);
! perms = new HashMap<>(permissions.size()*2);
perms.putAll(permissions);
// Get all_allowed
all_allowed = gfields.get("all_allowed", false);
< prev index next >