}
//Check types of the beans
if(comp.getClass() != superBean.getClass())
{
throw new DefinitionException("@Specialized Class : " + specializedClass.getName()
+ " and its super class may be the same type of bean,i.e, ManagedBean, SessionBean etc.");
}
if(superBean.getName() != null)
{
if(comp.getName() != null)
{
throw new DefinitionException("@Specialized Class : " + specializedClass.getName()
+ " may not explicitly declare a bean name");
}
comp.setName(superBean.getName());
comp.setSpecializedBean(true);