if (method != null) {
try {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
try {
return AccessController.doPrivileged(new PrivilegedMethodInvoker(method, target));
} catch (PrivilegedActionException exception) {
Exception throwableException = exception.getException();
if (throwableException instanceof IllegalAccessException) {
throw EntityManagerSetupException.cannotAccessMethodOnObject(method, target);
} else {