try {
Class<?> unsafe = Class.forName(REFLECTION_CLASS_NAME);
Field accessor = AccessController.doPrivileged(new GetDeclaredFieldAction(unsafe, "theUnsafe"));
AccessController.doPrivileged(SetAccessibleAction.of(accessor));
unsafeInstance = accessor.get(null);
allocateInstanceMethod = AccessController.doPrivileged(new GetDeclaredMethodAction(unsafe, "allocateInstance", Class.class));
} catch (Exception e) {
// OK to fail
}
}