Recently we came up across an observer resolution issue which concerns 10.3.1. Assignability of type variables, raw and parameterized types.
What happens when you are trying to assign a non-parameterized subclass to a parameterized superclass?
Here is a bit of code, we have following two classes:
Here is observer code:
And your event type is:
In this scenario, the spec is IMO unclear on what should happen in this particular case.
Looking at other parts of spec, we already have this covered in, for instance, delegate injection point assignability, where it says:
A raw bean type is considered assignable to a parameterized delegate type if the raw types are identical and all type parameters of the delegate type are either unbounded type variables or java.lang.Object.
I think we should add a similar sentence to 10.3.1. Assignability of type variables, raw and parameterized types. That way the spec will behave coherently and the above observer/event assignability should not work.
Side note - for the sample above to work, you would need to change the observed types to QualifiedEvent<?>.