Skip to content

Commit

Permalink
Use Reflections.invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
mbogoevici committed Dec 15, 2009
1 parent f629f4d commit 20510bb
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -17,7 +17,6 @@
package org.jboss.weld.bean.proxy;

import static org.jboss.weld.logging.messages.BeanMessage.UNEXPECTED_UNWRAPPED_CUSTOM_DECORATOR;
import static org.jboss.weld.util.reflection.Reflections.ensureAccessible;

import java.lang.reflect.Method;
import java.util.List;
Expand All @@ -32,6 +31,7 @@
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.jlr.MethodSignatureImpl;
import org.jboss.weld.serialization.spi.helpers.SerializableContextualInstance;
import org.jboss.weld.util.reflection.Reflections;

/**
* Method handler for decorated beans
Expand Down Expand Up @@ -82,6 +82,7 @@ protected Object doInvoke(Object self, Method method, Method proceed, Object[] a
for (SerializableContextualInstance<Decorator<Object>, Object> beanInstance : decoratorInstances)
{
WeldMethod<?, ?> decoratorMethod;

if (beanInstance.getContextual().get() instanceof DecoratorImpl<?>)
{
decoratorMethod = ((DecoratorImpl<?>)beanInstance.getContextual().get()).getAnnotatedItem().getWeldMethod(methodSignature);
Expand All @@ -100,6 +101,6 @@ else if (beanInstance.getContextual().get() instanceof AnnotatedItemProvidingDec
}
}

return ensureAccessible(method).invoke(getTargetInstance(), args);
return Reflections.invoke(method,getTargetInstance(), args);
}
}

0 comments on commit 20510bb

Please sign in to comment.