Skip to content

Commit

Permalink
Fix ri
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3235 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Jul 25, 2009
1 parent 9071d1a commit c6cdd3e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
Expand Up @@ -23,6 +23,8 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.spi.Decorator;

Expand Down Expand Up @@ -277,6 +279,7 @@ public void initialize(BeanDeployerEnvironment environment)
if (!isInitialized())
{
initConstructor();
checkConstructor();
super.initialize(environment);
initPostConstruct();
initPreDestroy();
Expand Down Expand Up @@ -369,6 +372,18 @@ protected void checkBeanImplementation()
}
}
}

protected void checkConstructor()
{
if (!constructor.getAnnotatedParameters(Disposes.class).isEmpty())
{
throw new DefinitionException("Managed bean constructor must not have a parameter annotated @Disposes " + constructor);
}
if (!constructor.getAnnotatedParameters(Observes.class).isEmpty())
{
throw new DefinitionException("Managed bean constructor must not have a parameter annotated @Observes " + constructor);
}
}

@Override
protected void preSpecialize(BeanDeployerEnvironment environment)
Expand Down

0 comments on commit c6cdd3e

Please sign in to comment.