ProtectionDomain pd;
if (client == null) {
pd = emptyPD;
} else {
synchronized (domains) {
WeakKey k;
while ((k = (WeakKey) queue.poll()) != null) {
domains.remove(k);
}
pd = (ProtectionDomain) domains.get(new WeakKey(client));
if (pd == null) {
Set set = client.getPrincipals();
Principal[] prins =
(Principal[]) set.toArray(new Principal[set.size()]);
pd = new ProtectionDomain(emptyCS, null, null, prins);
domains.put(new WeakKey(client, queue), pd);
}
}
}
boolean ok = pd.implies(permission);
// XXX what about logging