Author: marius.bogoevici
Date: 2009-10-28 23:24:52 -0400 (Wed, 28 Oct 2009)
New Revision: 4370
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java
Log:
one field went amiss
Modified: core/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java 2009-10-29
03:23:25 UTC (rev 4369)
+++
core/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java 2009-10-29
03:24:52 UTC (rev 4370)
@@ -30,6 +30,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.Decorator;
+import org.jboss.interceptor.util.InterceptionUtils;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.ForwardingWeldField;
import org.jboss.weld.introspector.WeldField;
@@ -75,7 +76,13 @@
{
try
{
- delegate().set(declaringInstance, manager.getInjectableReference(this,
creationalContext));
+ Object instanceToInject = declaringInstance;
+ if (!isDelegate())
+ {
+ // if declaringInstance is a proxy, unwrap it
+ instanceToInject = InterceptionUtils.getRawInstance(declaringInstance);
+ }
+ delegate().set(instanceToInject, manager.getInjectableReference(this,
creationalContext));
}
catch (IllegalArgumentException e)
{
Show replies by date