Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3251 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Jul 26, 2009
1 parent 33dd18f commit 9452a76
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
Expand Up @@ -32,6 +32,7 @@
import javax.enterprise.inject.Specializes;
import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.stereotype.Stereotype;

import org.jboss.webbeans.BeanManagerImpl;
Expand Down Expand Up @@ -157,6 +158,7 @@ public void initialize(BeanDeployerEnvironment environment)
initSerializable();
initProxyable();
initInjectionPoints();
checkInjectionPoints();
initDecorates();
checkDecorates();
}
Expand Down Expand Up @@ -293,6 +295,19 @@ private boolean checkInjectionPointsAreSerializable()
}
return true;
}

protected boolean checkInjectionPoints()
{
// TODO Merge serializable check in here
for (WBInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
{
if (!getScopeType().equals(Dependent.class) && injectionPoint.getType().equals(InjectionPoint.class))
{
throw new DefinitionException("Cannot inject an InjectionPoint into a non @Dependent scoped bean " + injectionPoint);
}
}
return true;
}

/**
* Initializes the scope type
Expand Down

0 comments on commit 9452a76

Please sign in to comment.