Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 3.0.0.CR2, 2.4.3.Final
-
Component/s: None
-
Labels:None
-
Forum Reference:
-
Git Pull Request:
Description
Right now, the following observers cannot be declared on an extension:
void first(@Observes Object foo, Bar bar) { } void second(@Observes @Foo Object foo, Bar bar) { }
whereas this one is allowed:
void third(@Observes Foo foo, Bar bar) { }
Note that the first observer would be notified even for container lifecycle events and so it's considered a container lifecycle event observer. However, the second observer is incorrectly considered a container lifecycle event observer too.
Observers.isContainerLifecycleObserverMethod() should return false for an observer with observed type java.lang.Object and a qualifier other than @Any.
Note that all the above observers are defined as non-portable in the spec. The problem is that extensions can communicate using events and so the required beans may be not discovered/available yet.
However, I think Weld should be consistent here. If third is allowed, the second should be allowed too.