Author: pete.muir(a)jboss.org
Date: 2009-03-14 13:21:07 -0400 (Sat, 14 Mar 2009)
New Revision: 1996
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
Log:
WBRI-181
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-03-14
17:10:09 UTC (rev 1995)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-03-14
17:21:07 UTC (rev 1996)
@@ -295,16 +295,23 @@
// This is a bit dangerous, as it means that producer methods can end of
// executing on partially constructed instances. Also, it's not required
// by the spec...
- if (creationalContext instanceof CreationalContextImpl)
+ if (getAnnotatedItem().isStatic())
{
- CreationalContextImpl<?> creationalContextImpl =
(CreationalContextImpl<?>) creationalContext;
- if (creationalContextImpl.containsIncompleteInstance(getDeclaringBean()))
+ return null;
+ }
+ else
+ {
+ if (creationalContext instanceof CreationalContextImpl)
{
- log.warn("Executing producer field or method " + getAnnotatedItem()
+ " on incomplete declaring bean " + getDeclaringBean() + " due to circular
injection");
- return creationalContextImpl.getIncompleteInstance(getDeclaringBean());
+ CreationalContextImpl<?> creationalContextImpl =
(CreationalContextImpl<?>) creationalContext;
+ if (creationalContextImpl.containsIncompleteInstance(getDeclaringBean()))
+ {
+ log.warn("Executing producer field or method " +
getAnnotatedItem() + " on incomplete declaring bean " + getDeclaringBean() +
" due to circular injection");
+ return creationalContextImpl.getIncompleteInstance(getDeclaringBean());
+ }
}
+ return manager.getInstance(getDeclaringBean());
}
- return getAnnotatedItem().isStatic() ? null :
manager.getInstance(getDeclaringBean());
}
/**