-
Bug
-
Resolution: Done
-
Major
-
2.1.2.Final
-
None
-
None
After upgrading from WELD 1.1.8.Final to 2.1.2.Final, I started to experience the following behavior.
I have two producer and two dispose methods producing/disposing instance of the same type. One pair is distinguished by a qualifier, the other pair is unqualified.
In version 1.1.8 this worked fine, the two couples where paired correctly.
In 2.1.2, this code produces an error
WELD-000077: Cannot declare multiple disposal methods for this producer method.
Producer method: org.jboss.weld.bootstrap.ConcurrentBeanDeployer@3c720215
Disposal methods:
- Disposer method [[BackedAnnotatedMethod] public Bean.disposeQualified(@Disposes @Qualified Something)],
- Disposer method [[BackedAnnotatedMethod] public Bean.dispose(@Disposes Something)]
at org.jboss.weld.bootstrap.AbstractBeanDeployer.resolveDisposalMethod(AbstractBeanDeployer.java:193)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.createProducerMethod(AbstractBeanDeployer.java:216)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.createProducerMethods(AbstractBeanDeployer.java:202)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.createObserversProducersDisposers(AbstractBeanDeployer.java:179)
IMO this is because the unqualified disposer method, claims that it can dispose any products of the type, qualified or not. Trying to resolve disposing method of @Qualified Something is thus ambiguous.
Is this intentional change in behavior? Is it possible to somehow specify that the unqualified disposal method should be used only for unqualified products of Something?