Class<?> specialClass = annotatedType.getJavaClass();
Class<?> superClass = specialClass.getSuperclass();
if(superClass.equals(Object.class))
{
throw new WebBeansDeploymentException(new WebBeansConfigurationException(WebBeansLoggerFacade.getTokenString(OWBLogConst.EXCEPT_0003)
+ specialClass.getName() + WebBeansLoggerFacade.getTokenString(OWBLogConst.EXCEPT_0004)));
}
if (superClassList.contains(superClass))
{
// since CDI 1.1 we have to wrap this in a DeploymentException
throw new WebBeansDeploymentException(new InconsistentSpecializationException(WebBeansLoggerFacade.getTokenString(OWBLogConst.EXCEPT_0005) +
superClass.getName()));
}
if (!containsAllSuperclassTypes(annotatedType, superClass, annotatedTypes))
{
throw new WebBeansDeploymentException(new InconsistentSpecializationException("@Specialized Class : " + specialClass.getName()
+ " must have all bean types of its super class"));
}
AnnotatedType<?> superType = getAnnotatedTypeForClass(annotatedTypes, superClass);
if (!webBeansUtil.isConstructorOk(superType))
{
throw new WebBeansDeploymentException(new InconsistentSpecializationException("@Specializes class " + specialClass.getName()
+ " does not extend a bean with a valid bean constructor"));
}
try
{
webBeansUtil.checkManagedBean(specialClass);
}
catch (WebBeansConfigurationException illegalBeanTypeException)
{
// this Exception gets thrown if the given class is not a valid bean type
throw new WebBeansDeploymentException(new InconsistentSpecializationException("@Specializes class " + specialClass.getName()
+ " does not extend a valid bean type", illegalBeanTypeException));
}
superClassList.add(superClass);