}
}
try
{
SoftReference collectionEntry = null;
PermissionCollection collection = null;
synchronized (m_cache)
{
collectionEntry = (SoftReference) m_cache.get(targetClass);
}
if (collectionEntry != null)
{
collection = (PermissionCollection) collectionEntry.get();
}
if (collection == null)
{
collection = target.newPermissionCollection();
if (collection == null)
{
collection = new DefaultPermissionCollection();
}
for (int i = 0; i < m_permissionInfos.length; i++)
{
PermissionInfo permissionInfo = m_permissionInfos[i];
String infoType = permissionInfo.getType();
String permissionType = targetClass.getName();
if (infoType.equals(permissionType))
{
Permission permission = createPermission(
permissionInfo, targetClass);
if (permission != null)
{
collection.add(permission);
}
}
}
synchronized (m_cache)
{
m_cache.put(new Entry(target.getClass(), m_queue),
new SoftReference(collection));
}
}
return collection.implies(target);
}