if (!decoratorList.isEmpty())
{
Class<?> clazz = bean.getReturnType();
if (ClassUtil.isFinal(clazz.getModifiers()))
{
throw new WebBeansConfigurationException("Bean : " + bean.getReturnType().getName() + " can not be declared final, because it has one or more decorators");
}
Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods)
{
int modifiers = method.getModifiers();
if (!method.isSynthetic() && !method.isBridge() && !Modifier.isStatic(modifiers) && !Modifier.isPrivate(modifiers) && ClassUtil.isFinal(modifiers))
{
// Check decorator implements this
Iterator<Decorator<?>> itDecorator = decoratorList.iterator();
while (itDecorator.hasNext())
{
WebBeansDecorator<?> decorator = (WebBeansDecorator<?>) itDecorator.next();
Class<?> decClazz = decorator.getClazz();
try
{
if (decClazz.getMethod(method.getName(), method.getParameterTypes()) != null)
{
throw new WebBeansConfigurationException("Bean : " + bean.getReturnType().getName() + " can not define non-private, non-static, final method : "
+ method.getName() + ", because one of its decorators implements this method");
}
}
catch (SecurityException e)