Skip to content

Commit

Permalink
check if the product is serializable!
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1284 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Jan 29, 2009
1 parent a9069d4 commit 1bc2327
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -200,13 +200,13 @@ protected void checkReturnValue(T instance)
{
return;
}
if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean()))
if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean()) && !isSerializable())
{
if (injectionPoint.getMember() instanceof Field)
{
if (!Reflections.isTransient(injectionPoint.getMember()))
{
throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into non-transient fields of passivating beans");
throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into non-transient fields of passivating beans\n\nProducer: " + this.toString() + "\nInjection Point: " + injectionPoint.toString());
}
}
else if (injectionPoint.getMember() instanceof Method)
Expand Down

0 comments on commit 1bc2327

Please sign in to comment.