public M getBean()
{
M bean = (M) new ManagedBean<>(webBeansContext, WebBeansType.MANAGED, annotatedType, beanAttributes, annotatedType.getJavaClass());
bean.setEnabled(webBeansContext.getWebBeansUtil().isBeanEnabled(beanAttributes, annotatedType, bean.getStereotypes()));
webBeansContext.getWebBeansUtil().checkManagedBeanCondition(annotatedType);
WebBeansUtil.checkGenericType(annotatedType.getJavaClass(), beanAttributes.getScope());
webBeansContext.getWebBeansUtil().validateBeanInjection(bean);
UnproxyableResolutionException lazyException = webBeansContext.getDeploymentValidationService().validateProxyable(bean, ignoreFinalMethods);
if (lazyException == null)
{
return bean;
}
return (M) new UnproxyableBean<>(webBeansContext, WebBeansType.MANAGED, beanAttributes, annotatedType, annotatedType.getJavaClass(), lazyException);
}
}