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

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Obsolete
    • 1.2.Final
    • None
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: