Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-436

Specialization requirements do not allow parameterized types to be specialized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major 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.

              Unassigned Unassigned
              bafco Matus Abaffy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: