Skip to content

Commit

Permalink
WELD-1782 Don't check the return value before the proxy is created
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba authored and jharting committed Nov 13, 2014
1 parent 0733d9b commit 6abd47c
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -130,18 +130,18 @@ protected void checkEEResource() {

@Override
public T create(CreationalContext<T> creationalContext) {
final T beanInstance = createUnderlying(creationalContext);
final T beanInstance = getProducer().produce(creationalContext);
if (Reflections.isFinal(rawType) || Serializable.class.isAssignableFrom(beanInstance.getClass())) {
return beanInstance;
return checkReturnValue(beanInstance);
} else {
BeanInstance proxyBeanInstance = new EnterpriseTargetBeanInstance(getTypes(), new CallableMethodHandler(new EEResourceCallable<T>(getBeanManager(),
this, creationalContext, beanInstance)));
return proxyFactory.create(proxyBeanInstance);
return checkReturnValue(proxyFactory.create(proxyBeanInstance));
}
}

/**
* Access to the underlying producer field
* Access to the underlying producer field, performs return value check.
*/
private T createUnderlying(CreationalContext<T> creationalContext) {
return super.create(creationalContext);
Expand Down

0 comments on commit 6abd47c

Please sign in to comment.