< prev index next >
src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java
Print this page
*** 59,69 ****
/**
* Create an empty UnresolvedPermissionCollection object.
*
*/
public UnresolvedPermissionCollection() {
! perms = new HashMap<String, List<UnresolvedPermission>>(11);
}
/**
* Adds a permission to this UnresolvedPermissionCollection.
* The key for the hash is the unresolved permission's type (class) name.
--- 59,69 ----
/**
* Create an empty UnresolvedPermissionCollection object.
*
*/
public UnresolvedPermissionCollection() {
! perms = new HashMap<>(11);
}
/**
* Adds a permission to this UnresolvedPermissionCollection.
* The key for the hash is the unresolved permission's type (class) name.
*** 80,90 ****
List<UnresolvedPermission> v;
synchronized (this) {
v = perms.get(up.getName());
if (v == null) {
! v = new ArrayList<UnresolvedPermission>();
perms.put(up.getName(), v);
}
}
synchronized (v) {
v.add(up);
--- 80,90 ----
List<UnresolvedPermission> v;
synchronized (this) {
v = perms.get(up.getName());
if (v == null) {
! v = new ArrayList<>();
perms.put(up.getName(), v);
}
}
synchronized (v) {
v.add(up);
*** 201,211 ****
// writeObject writes a Hashtable<String, Vector<UnresolvedPermission>>
// for the permissions key, so this cast is safe, unless the data is corrupt.
Hashtable<String, Vector<UnresolvedPermission>> permissions =
(Hashtable<String, Vector<UnresolvedPermission>>)
gfields.get("permissions", null);
! perms = new HashMap<String, List<UnresolvedPermission>>(permissions.size()*2);
// Convert each entry (Vector) into a List
Set<Map.Entry<String, Vector<UnresolvedPermission>>> set = permissions.entrySet();
for (Map.Entry<String, Vector<UnresolvedPermission>> e : set) {
// Convert Vector into ArrayList
--- 201,211 ----
// writeObject writes a Hashtable<String, Vector<UnresolvedPermission>>
// for the permissions key, so this cast is safe, unless the data is corrupt.
Hashtable<String, Vector<UnresolvedPermission>> permissions =
(Hashtable<String, Vector<UnresolvedPermission>>)
gfields.get("permissions", null);
! perms = new HashMap<>(permissions.size()*2);
// Convert each entry (Vector) into a List
Set<Map.Entry<String, Vector<UnresolvedPermission>>> set = permissions.entrySet();
for (Map.Entry<String, Vector<UnresolvedPermission>> e : set) {
// Convert Vector into ArrayList
< prev index next >