Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 3.0.0.Beta1
-
Component/s: Core
-
Labels:None
-
Affects:Documentation (Ref Guide, User Guide, etc.), Interactive Demo/Tutorial
-
Estimated Difficulty:Medium
Description
To be consist with CDI observers, the @Handles parameter should be allowed to be used in any position in the list of method arguments. The only restriction is that there is exactly one parameter annotated with @Handles (and it must be of type CaughtException).
Here is the relevant section on observer methods for reference:
"10.4.2. Declaring an observer method
An observer method may be declared by annotating a parameter @javax.enterprise.event.Observes. That parameter is the event parameter. The declared type of the parameter is the observed event type. If a method has more than one parameter annotated @Observes, the container automatically detects the problem and treats
it as a definition error."
So we should allow:
public void handle(BeanManager, @Handles CaughtException<Exception> ex) {}
Fixed with GitHub rev b537274