Skip to content

Commit

Permalink
WBRI-181
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1996 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Mar 14, 2009
1 parent 30d1998 commit b582b12
Showing 1 changed file with 13 additions and 6 deletions.
Expand Up @@ -295,16 +295,23 @@ protected Object getReceiver(CreationalContext<?> creationalContext)
// 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());
}

/**
Expand Down

0 comments on commit b582b12

Please sign in to comment.