When beans.xml contains {{bean-discovery-mode="annotated"}} then:
{code} public class SomeFactory { @Produces public SomeClass someClass() { return new SomeClass(); } } {code} doesn't register {{SomeClass}} with a @Dependent scope. Weld forces me to add some scope annotation: {{@ApplicationScoped, @SessionScoped, @RequestScoped, @Dependent}}. [CDI spec 3.3 Producer methods|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#producer_method] has examples without any scope annotations, so I guess it should be possible in Weld.
Expected behaviour: occurrence of `@Produces` annotation on a method should cause the returned class to be a default-scoped bean.
|