if (!decoratorList.isEmpty())
{
Class<?> clazz = component.getReturnType();
if (ClassUtil.isFinal(clazz.getModifiers()))
{
throw new WebBeansConfigurationException("Simple web bean component : " + component.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 (!ClassUtil.isStatic(modifiers) && !ClassUtil.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("Simple web bean component : " + component.getReturnType().getName() + " can not define non-private, non-static, final method : " + method.getName() + ", because one of its decorators implements this method");
}
}
catch (SecurityException e)