protected IdentityMap buildNewIdentityMap(Class identityMapClass, int size, ClassDescriptor descriptor) throws DescriptorException {
try {
Constructor constructor = null;
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try {
constructor = (Constructor)AccessController.doPrivileged(new PrivilegedGetConstructorFor(identityMapClass, new Class[] { ClassConstants.PINT, ClassDescriptor.class }, false));
IdentityMap map = (IdentityMap)AccessController.doPrivileged(new PrivilegedInvokeConstructor(constructor, new Object[] { new Integer(size), descriptor }));
if ((descriptor != null) && (descriptor.getCacheInterceptorClass() != null)) {
constructor = (Constructor)AccessController.doPrivileged(new PrivilegedGetConstructorFor(identityMapClass, new Class[] { IdentityMap.class, AbstractSession.class }, false));
Object params[] = new Object[]{map, getSession()};
map = (IdentityMap)AccessController.doPrivileged(new PrivilegedInvokeConstructor(constructor, params));
}
return map;
} catch (PrivilegedActionException exception) {