-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
1.2.Final
-
None
-
None
Formally, a bean X is said to specialize another bean Y if either:
...
Furthermore, X must have all the bean types of Y. If X does not have some bean type of Y, the container automatically detects the problem and treats it as a definition error.
The tricky part about having all the bean types is that two parameterized types might not equal (in the java sense) even though they "are the same". That's because of the inequality between type variables. Example:
class Foo<T> {}
class Bar<T> extends Foo<T> {}
Bar seems to have all the bean types of Foo, but it does not. Foo<T> from class Bar is not equal to Foo<T> from class Foo.
I suppose the intention of the spec. was that if bean X specializes bean Y, then for each bean type T of Y, X must have a bean type U that is assignable from T.
- relates to
-
WELD-1651 Specialization of generic beans throws inappropriate exception
- Resolved