@Override
public T create(BeanInstance beanInstance) {
try {
final T instance = super.create(beanInstance);
if (beanIdField == null) {
final Field f = AccessController.doPrivileged(new GetDeclaredFieldAction(instance.getClass(), BEAN_ID_FIELD));
AccessController.doPrivileged(SetAccessibleAction.of(f));
beanIdField = f;
}
if (threadLocalCacheField == null && isUsingUnsafeInstantiators()) {
final Field f = AccessController.doPrivileged(new GetDeclaredFieldAction(instance.getClass(), CACHE_FIELD));
AccessController.doPrivileged(SetAccessibleAction.of(f));
threadLocalCacheField = f;
}
if(isUsingUnsafeInstantiators()) {
threadLocalCacheField.set(instance, new ThreadLocal());